Time for action – using Selenium with TestNG

  1. Create a new Java project in Eclipse with name SeleniumSampleTest and with project structure shown in the following screenshot:
    Time for action – using Selenium with TestNG
  2. Open the SampleSeleniumTest file and add the following code snippet to it:
    package test.java.org.sample.selenium; import java.util.List; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.firefox.FirefoxDriver; import org.openqa.selenium.support.ui.ExpectedConditions; import org.openqa.selenium.support.ui.WebDriverWait; import org.testng.Assert; import org.testng.annotations.AfterMethod; import ...

Get TestNg Beginner's Guide now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.