mardi 20 décembre 2016

where to keep system.property in TestNG test case

where to add System.setProperty("webdriver.gecko.driver","//home//tuser//software//selenium//gecko_driver//geckodriver"); so that i can use my code without any error.

public class class1 {

public static String baseURL = "https://facebook.com/";
public WebDriver driver = new FirefoxDriver();

@Test(priority = 1)
public void login() throws InterruptedException {

    driver.get(baseURL);
    driver.manage().window().maximize();
    driver.findElement(By.id("username")).sendKeys("srikanth");
    driver.findElement(By.id("password")).sendKeys("sri");
    driver.findElement(By.id("login_button")).click();
    Thread.sleep(30000);
}

Aucun commentaire:

Enregistrer un commentaire