TestNG Testing Framework For Selenium Part 1
TestNG Testing Framework For Selenium Part 1
com)
Note:
Java - JUnit, TestNG
C#.NET - NUnit
PHP - Behat+Mink
Ruby - Repect, Test:Unit,
Python - PyUnit, Py:Test
- Initially developed for Unit Testing, now used for all levels of Testing
In Eclipse IDE,
- Help Menu,
- Select "install New Software"
- Click "Add"
- Enter name as "TestNG"
- Enter URL as "http://beust.com/eclipse/
- Click OK
Then "TestNG" will be populated,
- Select "TestNG"
- Next
- Next
- accept the agreement
- Finish
Test Steps:
i) Launch the Browser
ii) Navigate to Google Home page (https://www.google.com/)
Expected Result:
"Google"
Verification Point:
Capture the Page Title and compare with expected
Test Data/Input:
NA
/*if (pageTitle.equals("Google2")){
System.out.println("Google Application was Launched - Passed");
}
else {
System.out.println("Google Application was Not Launched - Failed");
}*/
Assert.assertEquals("Google", pageTitle);
}
@AfterMethod
public void closeBrowser(){
driver.close();
}
}
..................................