Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
XtremeTesting ThoughtWorks
src
src test
main
java
java
search
login
orders
testresources
pageobjects
steps
util
Instructio...
XtremeTesting ThoughtWorks
{
// add code
}
@Test
public void verifyInvalidLogintoSpree()
{
//add code
}
# Create testng xm...
XtremeTesting ThoughtWorks
Add it to tests
@Test(groups = {"smoke"}, priority = 2)
# Set Before suite and After Suite
@Bef...
XtremeTesting ThoughtWorks
loginPage.clickSubmit();
return loginPage.getInvalidLoginText();}
Test
@Test
public void verify...
You’ve finished this document.
Download and read it offline.
Upcoming SlideShare
Tw specifications for-testing1
Next
Upcoming SlideShare
Tw specifications for-testing1
Next
Download to read offline and view in fullscreen.

Share

Automation Frame works Instruction Sheet

Download to read offline

Follow the steps to create Test Framework using TenstNG, Modeling Framework using Page Object Modeling and Test Driving Framework using Data Driven

Related Books

Free with a 30 day trial from Scribd

See all

Automation Frame works Instruction Sheet

  1. 1. XtremeTesting ThoughtWorks src src test main java java search login orders testresources pageobjects steps util Instructions # Create a project Create a maven project with below dependencies <dependencies> <dependency> <groupId>org.seleniumhq.selenium</groupId> <artifactId>selenium-java</artifactId> <version>3.0.0</version> </dependency> <dependency> <groupId>org.testng</groupId> <artifactId>testng</artifactId> <version>6.9.13.6</version> </dependency> <dependency> <groupId>com.beust</groupId> <artifactId>jcommander</artifactId> <version>1.48</version> </dependency> </dependencies> # Create Below Folder structure # Write TestNG Tests Login Tests @Test public void verifyValidLogintoSpree()
  2. 2. XtremeTesting ThoughtWorks { // add code } @Test public void verifyInvalidLogintoSpree() { //add code } # Create testng xml <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" > <suite name="Regression"> <test name="regression"> <classes> <class name="login.LoginTest"/> <class name="search.SearchProductsTest" /> </classes> </test> </suite> # ExecuteTests java -cp <tests classes path>:<test ng jar path>:<jcommander jar path> org.testng.TestNG testng.xml #Tag tests and Set Priority Add it to xml <groups> <run> <include name="regression" /> <exclude name="sanity" /> </run> </groups>
  3. 3. XtremeTesting ThoughtWorks Add it to tests @Test(groups = {"smoke"}, priority = 2) # Set Before suite and After Suite @BeforeSuite public void verifyBeforeSuite() { DriverManager manager = new DriverManager(); } # Create Page Objects public class HomePage { @FindBy(how= How.LINK_TEXT, using = "MY ACCOUNT") WebElement my_account; @FindBy(how= How.ID, using = "link-to-login") WebElement login_link; @FindBy(how= How.LINK_TEXT, using = "LOGOUT") WebElement logout; public void clickOnLoginLink() { login_link.click();} public String getMyAccountText() { return my_account.getText();} public void clickLogOut() { logout.click(); } } # Separate out Tests , Objects , and Implementation Flows Steps public String InvalidLogin(String userName, String password) { HomePage homePage = PageFactory.initElements(DriverManager.driver, HomePage.class); homePage.clickOnLoginLink(); LoginPage loginPage = PageFactory.initElements(DriverManager.driver, LoginPage.class); loginPage.enterUsername(userName); loginPage.enterPassword(password);
  4. 4. XtremeTesting ThoughtWorks loginPage.clickSubmit(); return loginPage.getInvalidLoginText();} Test @Test public void verifyValidLogintoSpree() { LoginSteps loginSteps = new LoginSteps(); String expected_message = loginSteps.Login("xt@xt.xom", "xtxtxt"); Assert.assertEquals(expected_message, "MY ACCOUNT"); } # Parameterize Tests Add it to xml <parameter name="userName" value="xt@xt.xom"/> <parameter name="password" value="xtxtxt" /> Add it to tests @Test @Parameters({"userName", "password"}) public void verifyValidLogintoSpree(String userName, String password) # Data Providers @DataProvider(name = "login") public static Object[][] loginData() { return new Object[][] {{"xt@xt.xom", "xtxtxt"}, {"xt@xt.xom", "xtxtxt"}};} @Test (dataProvider = "login") public void verifyValidLogintoSpreeWithDataProvider(String userName, String password)
  • formesaid

    Aug. 20, 2020
  • kennylflim

    Apr. 23, 2020

Follow the steps to create Test Framework using TenstNG, Modeling Framework using Page Object Modeling and Test Driving Framework using Data Driven

Views

Total views

495

On Slideshare

0

From embeds

0

Number of embeds

0

Actions

Downloads

11

Shares

0

Comments

0

Likes

2

×