Parameterization in TestNG Using DataProvider Annotation
package seleniumprograms; import java.util.concurrent.TimeUnit; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import org.testng.Assert; import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeMethod; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; public class Parameterization { WebDriver driver; @BeforeMethod public void setUp(){ System.setProperty("webdriver.chrome.driver",System.getProperty("user.dir")+"\\drivers\\chromedriver.exe"); driver = new ChromeDriver(); driver.get("http://newtours.demoaut.com/"); driver.manage().window().maximize(); driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS); driver.manage().timeouts().pageLoadTimeout(60, TimeUnit.SECONDS); } @Test(dataProvider="loginDataProvider") public void search(String username, String password, String ...