The following are the solutions for this chapter.
Chapter 7: Writing Tests
Activity: Creating a TestNG Test
- Analyze the GiganticStoreScript class we built in earlier in this chapter:
public class GiganticStoreScript {
public static void main(String[] args) {
checkGiganticStore();
}
private static void checkGiganticStore() {
WebDriver driver = new ChromeDriver();
HomePage homePage = new HomePage(driver);
homePage.open();
ProductsPage productsPage = homePage.goToProducts();
// Verify results in products page
String productsMainInfo = "Here's the stuff we sell";
if (productsMainInfo.equalsIgnoreCase(productsPage.getMainInfo())) {
System.out.println("Products main...