{
val=msg;
Assert.assertEquals(val, "SignOut");
break;
}
}
}
@test(dataProvider="data")
public void add_course(String co, String rol) {
WebElement course=driver.findElement(By.xpath("//[@id=\"course\"]"));
Select sel=new Select(course);
sel.selectByVisibleText(co);
WebElement role=driver.findElement(By.xpath("//[@id=\"role\"]"));
Select sel1=new Select(role);
sel1.selectByVisibleText(rol);
driver.findElement(By.xpath("/html/body/div[3]/form/button[1]")).click();
}
@DataProvider
public Object[][] data()
{
Object[][] a=new Object[2][2];
a[0][0]="Selenium Using Python";
a[0][1]="Educator";
a[1][0]="Agile Testing";
a[1][1]="Co-Educator";
return a;
}
@AfterClass
public void teardown()
{
driver.findElement(By.xpath("/html/body/nav/div/div[2]/ul/li/a")).click();
driver.close();
driver.quit();
}
}
**** For this code we have to convert to testng or write the following code in testng.xml if it is already present in the files ****
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
Top comments (0)