Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
Selenium TestNG POM and Factories Assignment
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex Segers
Selenium TestNG POM and Factories Assignment
Commits
3ae2fd1f
Commit
3ae2fd1f
authored
Apr 14, 2021
by
Alex Segers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Initial commit [
@asegers
] -- Assignment Complete
parents
Changes
17
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
564 additions
and
0 deletions
+564
-0
.gitignore
.gitignore
+45
-0
README.md
README.md
+11
-0
pom.xml
pom.xml
+31
-0
AccountSettingsPF.java
...a/com/nisum/safeway/page_factories/AccountSettingsPF.java
+47
-0
HomePF.java
src/main/java/com/nisum/safeway/page_factories/HomePF.java
+53
-0
LoginPF.java
src/main/java/com/nisum/safeway/page_factories/LoginPF.java
+63
-0
AccountSettingsPage.java
...ain/java/com/nisum/safeway/pages/AccountSettingsPage.java
+37
-0
HomePage.java
src/main/java/com/nisum/safeway/pages/HomePage.java
+37
-0
LoginPage.java
src/main/java/com/nisum/safeway/pages/LoginPage.java
+47
-0
UserProperties.java
src/main/java/properties/UserProperties.java
+21
-0
AccountSettingsPFTests.java
.../nisum/safeway/page_factories/AccountSettingsPFTests.java
+24
-0
HomePFTests.java
...st/java/com/nisum/safeway/page_factories/HomePFTests.java
+23
-0
LoginPFTests.java
...t/java/com/nisum/safeway/page_factories/LoginPFTests.java
+25
-0
AccountSettingsPageTests.java
...ava/com/nisum/safeway/pages/AccountSettingsPageTests.java
+24
-0
HomePageTests.java
src/test/java/com/nisum/safeway/pages/HomePageTests.java
+25
-0
LoginPageTests.java
src/test/java/com/nisum/safeway/pages/LoginPageTests.java
+24
-0
SeleniumPageTest.java
src/test/java/com/nisum/safeway/pages/SeleniumPageTest.java
+27
-0
No files found.
.gitignore
0 → 100644
View file @
3ae2fd1f
*#
*.iml
*.ipr
*.iws
*.jar
*.sw?
*~
.#*
.*.md.html
.DS_Store
.attach_pid*
.classpath
.factorypath
.gradle
.idea
.metadata
.project
.recommenders
.settings
.springBeans
.vscode
/code
MANIFEST.MF
_site/
activemq-data
bin
build
!/**/src/**/bin
!/**/src/**/build
build.log
dependency-reduced-pom.xml
dump.rdb
interpolated*.xml
lib/
manifest.yml
out
overridedb.*
target
transaction-logs
.flattened-pom.xml
secrets.yml
.gradletasknamecache
.sts4-cache
*.properties
\ No newline at end of file
README.md
0 → 100644
View file @
3ae2fd1f
# Assignment Details
Create a maven project and provide all the dependencies.
Use Selenium 3.x.x (latest).
Use TestNG / JUnit.
Write generic code which will work with any type of browser. Browser may be a parameter.
Make appropriate arrangements for identifying the OS and picking up the correct driver for that particular OS.
1.
Assume that you have a user registered on safeway.com. All the details of the account that was registered are stored in a property file.
2.
Create Page Classes for Home Page, Login Page, Account Settings Page.
3.
Verify all the details from the property file using proper testNG/JUnit assertions.
\ No newline at end of file
pom.xml
0 → 100644
View file @
3ae2fd1f
<?xml version="1.0" encoding="UTF-8"?>
<project
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
>
<modelVersion>
4.0.0
</modelVersion>
<groupId>
com.nisum.asegers
</groupId>
<artifactId>
selenium-testng-pom-exercise
</artifactId>
<version>
1.0-SNAPSHOT
</version>
<properties>
<maven.compiler.source>
8
</maven.compiler.source>
<maven.compiler.target>
8
</maven.compiler.target>
</properties>
<dependencies>
<!-- https://mvnrepository.com/artifact/org.testng/testng -->
<dependency>
<groupId>
org.testng
</groupId>
<artifactId>
testng
</artifactId>
<version>
6.8
</version>
<scope>
test
</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-java -->
<dependency>
<groupId>
org.seleniumhq.selenium
</groupId>
<artifactId>
selenium-java
</artifactId>
<version>
3.141.59
</version>
</dependency>
</dependencies>
</project>
\ No newline at end of file
src/main/java/com/nisum/safeway/page_factories/AccountSettingsPF.java
0 → 100644
View file @
3ae2fd1f
package
com
.
nisum
.
safeway
.
page_factories
;
import
org.openqa.selenium.WebDriver
;
import
org.openqa.selenium.WebElement
;
import
org.openqa.selenium.chrome.ChromeDriver
;
import
org.openqa.selenium.support.FindBy
;
import
org.openqa.selenium.support.PageFactory
;
import
org.openqa.selenium.support.ui.ExpectedConditions
;
import
org.openqa.selenium.support.ui.WebDriverWait
;
import
java.util.concurrent.TimeUnit
;
public
class
AccountSettingsPF
{
WebDriver
driver
;
public
AccountSettingsPF
(
WebDriver
driver
)
{
this
.
driver
=
driver
;
PageFactory
.
initElements
(
this
.
driver
,
this
);
}
@FindBy
(
id
=
"input-firstName"
)
WebElement
inpFirstName
;
@FindBy
(
id
=
"input-lastName"
)
WebElement
inpLastName
;
@FindBy
(
id
=
"emailIdaccount"
)
WebElement
inpEmail
;
@FindBy
(
xpath
=
"//p[contains(text(), 'Personal Information')]"
)
WebElement
parPersonalInformation
;
public
void
authenticateAndNavigate
()
{
HomePF
homePF
=
new
HomePF
(
driver
);
homePF
.
navigateToAccountSettings
();
new
WebDriverWait
(
driver
,
20
).
until
(
ExpectedConditions
.
visibilityOf
(
parPersonalInformation
));
}
public
static
void
main
(
String
[]
args
)
{
System
.
setProperty
(
"webdriver.chrome.driver"
,
"/Users/asegers/Drivers/chromedriver"
);
WebDriver
driver
=
new
ChromeDriver
();
driver
.
manage
().
timeouts
().
implicitlyWait
(
5
,
TimeUnit
.
SECONDS
);
AccountSettingsPF
accountSettingsPF
=
new
AccountSettingsPF
(
driver
);
accountSettingsPF
.
authenticateAndNavigate
();
driver
.
quit
();
}
}
src/main/java/com/nisum/safeway/page_factories/HomePF.java
0 → 100644
View file @
3ae2fd1f
package
com
.
nisum
.
safeway
.
page_factories
;
import
org.openqa.selenium.WebDriver
;
import
org.openqa.selenium.WebElement
;
import
org.openqa.selenium.chrome.ChromeDriver
;
import
org.openqa.selenium.support.FindBy
;
import
org.openqa.selenium.support.FindBys
;
import
org.openqa.selenium.support.PageFactory
;
import
properties.UserProperties
;
import
java.util.concurrent.TimeUnit
;
public
class
HomePF
{
WebDriver
driver
;
public
HomePF
(
WebDriver
driver
)
{
this
.
driver
=
driver
;
PageFactory
.
initElements
(
this
.
driver
,
this
);
}
@FindBys
({
@FindBy
(
className
=
"menu-nav__profile-button"
),
@FindBy
(
xpath
=
"//a[contains(text(), 'Account')]"
)
})
WebElement
lnkAccount
;
@FindBy
(
xpath
=
"//a[contains(text(), 'Account Settings')]"
)
WebElement
menuItemAccountSettings
;
@FindBy
(
className
=
"sidebar__user-welcome__message"
)
WebElement
welcomeMsg
;
public
void
authenticate
()
{
LoginPF
loginPF
=
new
LoginPF
(
driver
);
loginPF
.
login
(
UserProperties
.
get
(
"email"
),
UserProperties
.
get
(
"password"
));
}
public
void
navigateToAccountSettings
()
{
authenticate
();
// PageFactory.initElements(this.driver, this);
lnkAccount
.
click
();
menuItemAccountSettings
.
click
();
}
public
static
void
main
(
String
[]
args
)
{
System
.
setProperty
(
"webdriver.chrome.driver"
,
"/Users/asegers/Drivers/chromedriver"
);
WebDriver
driver
=
new
ChromeDriver
();
driver
.
manage
().
timeouts
().
implicitlyWait
(
5
,
TimeUnit
.
SECONDS
);
HomePF
homePF
=
new
HomePF
(
driver
);
homePF
.
navigateToAccountSettings
();
driver
.
quit
();
}
}
src/main/java/com/nisum/safeway/page_factories/LoginPF.java
0 → 100644
View file @
3ae2fd1f
package
com
.
nisum
.
safeway
.
page_factories
;
import
org.openqa.selenium.WebDriver
;
import
org.openqa.selenium.WebElement
;
import
org.openqa.selenium.chrome.ChromeDriver
;
import
org.openqa.selenium.support.FindBy
;
import
org.openqa.selenium.support.FindBys
;
import
org.openqa.selenium.support.PageFactory
;
import
org.openqa.selenium.support.ui.ExpectedConditions
;
import
org.openqa.selenium.support.ui.WebDriverWait
;
import
properties.UserProperties
;
import
java.util.concurrent.TimeUnit
;
public
class
LoginPF
{
WebDriver
driver
;
final
String
HOME_URL
=
"https://www.safeway.com/"
;
public
LoginPF
(
WebDriver
driver
)
{
this
.
driver
=
driver
;
PageFactory
.
initElements
(
this
.
driver
,
this
);
driver
.
navigate
().
to
(
HOME_URL
);
}
@FindBys
({
@FindBy
(
className
=
"menu-nav__profile-button"
),
@FindBy
(
xpath
=
"//a[@title='Your profile']"
)
})
WebElement
lnkSignIn
;
@FindBy
(
id
=
"sign-in-modal-link"
)
WebElement
menuItemSignIn
;
@FindBy
(
id
=
"label-email"
)
WebElement
inpEmail
;
@FindBy
(
id
=
"label-password"
)
WebElement
inpPassword
;
@FindBy
(
id
=
"btnSignIn"
)
WebElement
btnSignIn
;
public
void
login
(
String
email
,
String
password
)
{
lnkSignIn
.
click
();
menuItemSignIn
.
click
();
new
WebDriverWait
(
driver
,
5
).
until
(
ExpectedConditions
.
elementToBeClickable
(
inpEmail
));
inpEmail
.
sendKeys
(
email
);
new
WebDriverWait
(
driver
,
5
).
until
(
ExpectedConditions
.
elementToBeClickable
(
inpPassword
));
inpPassword
.
sendKeys
(
password
);
btnSignIn
.
click
();
// Wait for link w/ text "Sign In / Up" to be unattached from the DOM, signaling a page refresh and successful authentication
new
WebDriverWait
(
driver
,
20
).
until
(
ExpectedConditions
.
stalenessOf
(
lnkSignIn
));
}
public
static
void
main
(
String
[]
args
)
{
System
.
setProperty
(
"webdriver.chrome.driver"
,
"/Users/asegers/Drivers/chromedriver"
);
WebDriver
driver
=
new
ChromeDriver
();
driver
.
manage
().
timeouts
().
implicitlyWait
(
5
,
TimeUnit
.
SECONDS
);
LoginPF
loginPF
=
new
LoginPF
(
driver
);
loginPF
.
login
(
UserProperties
.
get
(
"email"
),
UserProperties
.
get
(
"password"
));
driver
.
quit
();
}
}
src/main/java/com/nisum/safeway/pages/AccountSettingsPage.java
0 → 100644
View file @
3ae2fd1f
package
com
.
nisum
.
safeway
.
pages
;
import
org.openqa.selenium.By
;
import
org.openqa.selenium.WebDriver
;
import
org.openqa.selenium.WebElement
;
import
org.openqa.selenium.support.ui.ExpectedConditions
;
import
org.openqa.selenium.support.ui.WebDriverWait
;
public
class
AccountSettingsPage
{
WebDriver
driver
;
public
AccountSettingsPage
(
WebDriver
driver
)
{
this
.
driver
=
driver
;
}
public
WebElement
getInpFirstName
()
{
return
driver
.
findElement
(
By
.
id
(
"input-firstName"
));
}
public
WebElement
getInpLastName
()
{
return
driver
.
findElement
(
By
.
id
(
"input-lastName"
));
}
public
WebElement
getInpEmail
()
{
return
driver
.
findElement
(
By
.
id
(
"emailIdaccount"
));
}
public
WebElement
getParPersonalInformation
()
{
return
driver
.
findElement
(
By
.
xpath
(
"//p[contains(text(), 'Personal Information')]"
));
}
public
void
authenticateAndNavigate
()
{
HomePage
homePage
=
new
HomePage
(
driver
);
homePage
.
navigateToAccountSettings
();
new
WebDriverWait
(
driver
,
20
).
until
(
ExpectedConditions
.
visibilityOf
(
getParPersonalInformation
()));
}
}
src/main/java/com/nisum/safeway/pages/HomePage.java
0 → 100644
View file @
3ae2fd1f
package
com
.
nisum
.
safeway
.
pages
;
import
org.openqa.selenium.By
;
import
org.openqa.selenium.WebDriver
;
import
org.openqa.selenium.WebElement
;
import
properties.UserProperties
;
public
class
HomePage
{
WebDriver
driver
;
public
HomePage
(
WebDriver
driver
)
{
this
.
driver
=
driver
;
}
public
WebElement
getLnkAccount
()
{
return
driver
.
findElement
(
By
.
className
(
"menu-nav__profile-button-sign-in-up"
));
}
public
WebElement
getMenuItemAccountSettings
()
{
return
driver
.
findElement
(
By
.
xpath
(
"//a[contains(text(), 'Account Settings')]"
));
}
public
WebElement
getWelcomeMsg
()
{
return
driver
.
findElement
(
By
.
className
(
"sidebar__user-welcome__message"
));
}
public
void
authenticate
()
{
LoginPage
loginPage
=
new
LoginPage
(
driver
);
loginPage
.
login
(
UserProperties
.
get
(
"email"
),
UserProperties
.
get
(
"password"
));
}
public
void
navigateToAccountSettings
()
{
authenticate
();
getLnkAccount
().
click
();
getMenuItemAccountSettings
().
click
();
}
}
src/main/java/com/nisum/safeway/pages/LoginPage.java
0 → 100644
View file @
3ae2fd1f
package
com
.
nisum
.
safeway
.
pages
;
import
org.openqa.selenium.By
;
import
org.openqa.selenium.WebDriver
;
import
org.openqa.selenium.WebElement
;
import
org.openqa.selenium.support.ui.ExpectedConditions
;
import
org.openqa.selenium.support.ui.WebDriverWait
;
public
class
LoginPage
{
WebDriver
driver
;
final
String
HOME_URL
=
"https://www.safeway.com/"
;
public
LoginPage
(
WebDriver
driver
)
{
this
.
driver
=
driver
;
driver
.
navigate
().
to
(
HOME_URL
);
}
public
WebElement
getLnkSignIn
()
{
return
driver
.
findElement
(
By
.
className
(
"menu-nav__profile-button"
));
}
public
WebElement
getMenuItemSignIn
()
{
return
driver
.
findElement
(
By
.
id
(
"sign-in-modal-link"
));
}
public
WebElement
getInpEmail
()
{
return
driver
.
findElement
(
By
.
id
(
"label-email"
));
}
public
WebElement
getInpPassword
()
{
return
driver
.
findElement
(
By
.
id
(
"label-password"
));
}
public
WebElement
getBtnSignIn
()
{
return
driver
.
findElement
(
By
.
id
(
"btnSignIn"
));
}
public
void
login
(
String
email
,
String
password
)
{
getLnkSignIn
().
click
();
getMenuItemSignIn
().
click
();
new
WebDriverWait
(
driver
,
5
).
until
(
ExpectedConditions
.
elementToBeClickable
(
getInpEmail
()));
getInpEmail
().
sendKeys
(
email
);
new
WebDriverWait
(
driver
,
5
).
until
(
ExpectedConditions
.
elementToBeClickable
(
getInpPassword
()));
getInpPassword
().
sendKeys
(
password
);
getBtnSignIn
().
click
();
// Wait for link w/ text "Sign In / Up" to be unattached from the DOM, signaling a page refresh and successful authentication
new
WebDriverWait
(
driver
,
15
).
until
(
ExpectedConditions
.
stalenessOf
(
getLnkSignIn
()));
}
}
src/main/java/properties/UserProperties.java
0 → 100644
View file @
3ae2fd1f
package
properties
;
import
java.io.FileInputStream
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.util.Properties
;
public
class
UserProperties
{
static
public
String
get
(
String
propertyName
)
{
try
(
InputStream
input
=
new
FileInputStream
(
"src/main/resources/account.properties"
))
{
Properties
properties
=
new
Properties
();
properties
.
load
(
input
);
if
(
properties
.
containsKey
(
propertyName
))
return
properties
.
getProperty
(
propertyName
);
}
catch
(
IOException
ex
)
{
ex
.
printStackTrace
();
}
return
null
;
}
}
src/test/java/com/nisum/safeway/page_factories/AccountSettingsPFTests.java
0 → 100644
View file @
3ae2fd1f
package
com
.
nisum
.
safeway
.
page_factories
;
import
com.nisum.safeway.pages.SeleniumPageTest
;
import
org.testng.annotations.BeforeTest
;
import
org.testng.annotations.Test
;
import
properties.UserProperties
;
import
static
org
.
testng
.
Assert
.
assertEquals
;
public
class
AccountSettingsPFTests
extends
SeleniumPageTest
{
AccountSettingsPF
pageFactory
;
@BeforeTest
public
void
authenticate
()
{
pageFactory
=
new
AccountSettingsPF
(
driver
);
pageFactory
.
authenticateAndNavigate
();
}
@Test
public
void
userDetailsArePresent
()
{
assertEquals
(
UserProperties
.
get
(
"firstName"
),
pageFactory
.
inpFirstName
.
getAttribute
(
"value"
));
assertEquals
(
UserProperties
.
get
(
"lastName"
),
pageFactory
.
inpLastName
.
getAttribute
(
"value"
));
assertEquals
(
UserProperties
.
get
(
"email"
),
pageFactory
.
inpEmail
.
getAttribute
(
"value"
));
}
}
src/test/java/com/nisum/safeway/page_factories/HomePFTests.java
0 → 100644
View file @
3ae2fd1f
package
com
.
nisum
.
safeway
.
page_factories
;
import
com.nisum.safeway.pages.SeleniumPageTest
;
import
org.testng.annotations.BeforeTest
;
import
org.testng.annotations.Test
;
import
properties.UserProperties
;
import
static
org
.
testng
.
Assert
.
assertEquals
;
public
class
HomePFTests
extends
SeleniumPageTest
{
HomePF
pageFactory
;
@BeforeTest
public
void
authenticate
()
{
pageFactory
=
new
HomePF
(
driver
);
pageFactory
.
authenticate
();
}
@Test
public
void
welcomeMsgContainsUserFirstName
()
{
pageFactory
.
lnkAccount
.
click
();
assertEquals
(
"Hi "
+
UserProperties
.
get
(
"firstName"
),
pageFactory
.
welcomeMsg
.
getText
());
}
}
src/test/java/com/nisum/safeway/page_factories/LoginPFTests.java
0 → 100644
View file @
3ae2fd1f
package
com
.
nisum
.
safeway
.
page_factories
;
import
com.nisum.safeway.pages.SeleniumPageTest
;
import
org.openqa.selenium.WebElement
;
import
org.testng.annotations.BeforeTest
;
import
org.testng.annotations.Test
;
import
static
org
.
testng
.
Assert
.
assertTrue
;
import
properties.UserProperties
;
public
class
LoginPFTests
extends
SeleniumPageTest
{
LoginPF
pageFactory
;
@BeforeTest
public
void
authenticate
()
{
pageFactory
=
new
LoginPF
(
driver
);
pageFactory
.
login
(
UserProperties
.
get
(
"email"
),
UserProperties
.
get
(
"password"
));
}
@Test
public
void
lnkAccountShouldBeVisible
()
{
WebElement
lnkAccount
=
new
HomePF
(
driver
).
lnkAccount
;
assertTrue
(
lnkAccount
.
isDisplayed
(),
"Account link is visible"
);
}
}
src/test/java/com/nisum/safeway/pages/AccountSettingsPageTests.java
0 → 100644
View file @
3ae2fd1f
package
com
.
nisum
.
safeway
.
pages
;
import
org.testng.annotations.BeforeTest
;
import
org.testng.annotations.Test
;
import
static
org
.
testng
.
Assert
.
assertEquals
;
import
properties.UserProperties
;
public
class
AccountSettingsPageTests
extends
SeleniumPageTest
{
AccountSettingsPage
page
;
@BeforeTest
public
void
authenticateAndNavigate
()
{
this
.
page
=
new
AccountSettingsPage
(
driver
);
page
.
authenticateAndNavigate
();
}
@Test
public
void
userDetailsArePresent
()
{
assertEquals
(
UserProperties
.
get
(
"firstName"
),
page
.
getInpFirstName
().
getAttribute
(
"value"
));
assertEquals
(
UserProperties
.
get
(
"lastName"
),
page
.
getInpLastName
().
getAttribute
(
"value"
));
assertEquals
(
UserProperties
.
get
(
"email"
),
page
.
getInpEmail
().
getAttribute
(
"value"
));
}
}
src/test/java/com/nisum/safeway/pages/HomePageTests.java
0 → 100644
View file @
3ae2fd1f
package
com
.
nisum
.
safeway
.
pages
;
import
org.openqa.selenium.WebElement
;
import
org.testng.annotations.BeforeTest
;
import
org.testng.annotations.Test
;
import
static
org
.
testng
.
Assert
.
assertEquals
;
import
properties.UserProperties
;
public
class
HomePageTests
extends
SeleniumPageTest
{
HomePage
page
;
@BeforeTest
public
void
authenticate
()
{
page
=
new
HomePage
(
driver
);
page
.
authenticate
();
}
@Test
public
void
welcomeMsgContainsUserFirstName
()
{
page
.
getLnkAccount
().
click
();
WebElement
welcomeMsg
=
page
.
getWelcomeMsg
();
assertEquals
(
"Hi "
+
UserProperties
.
get
(
"firstName"
),
welcomeMsg
.
getText
());
}
}
src/test/java/com/nisum/safeway/pages/LoginPageTests.java
0 → 100644
View file @
3ae2fd1f
package
com
.
nisum
.
safeway
.
pages
;
import
org.openqa.selenium.WebElement
;
import
org.testng.annotations.BeforeTest
;
import
org.testng.annotations.Test
;
import
static
org
.
testng
.
Assert
.
assertTrue
;
import
properties.UserProperties
;
public
class
LoginPageTests
extends
SeleniumPageTest
{
LoginPage
page
;
@BeforeTest
public
void
authenticate
()
{
page
=
new
LoginPage
(
driver
);
page
.
login
(
UserProperties
.
get
(
"email"
),
UserProperties
.
get
(
"password"
));
}
@Test
public
void
lnkAccountShouldBeVisible
()
{
WebElement
lnkAccount
=
new
HomePage
(
driver
).
getLnkAccount
();
assertTrue
(
lnkAccount
.
isDisplayed
(),
"Account link is visible"
);
}
}
src/test/java/com/nisum/safeway/pages/SeleniumPageTest.java
0 → 100644
View file @
3ae2fd1f
package
com
.
nisum
.
safeway
.
pages
;
import
org.openqa.selenium.WebDriver
;
import
org.openqa.selenium.chrome.ChromeDriver
;
import
org.testng.annotations.AfterTest
;
import
org.testng.annotations.BeforeTest
;
import
java.util.concurrent.TimeUnit
;
public
abstract
class
SeleniumPageTest
{
public
WebDriver
driver
;
@BeforeTest
public
void
setUp
()
{
System
.
setProperty
(
"webdriver.chrome.driver"
,
"/Users/asegers/Drivers/chromedriver"
);
this
.
driver
=
new
ChromeDriver
();
this
.
driver
.
manage
().
timeouts
().
implicitlyWait
(
5
,
TimeUnit
.
SECONDS
);
}
@AfterTest
public
void
tearDown
()
{
driver
.
quit
();
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment