我的代码:
@Test(priority = 9, dataProvider = "refno")
public void searchAgain(String reffno) throws InterruptedException {
Thread.sleep(5000);
String str1 = reffno;
driver.findElement(By.xpath("//*[@id='ContentPlaceHolder1_txtref']")).sendKeys(str1);
driver.findElement(By.xpath("//*[@id='ContentPlaceHolder1_imgSearch']")).click();
driver.findElement(By.xpath("//*[@id='ContentPlaceHolder1_txtref']")).clear();
}
答案 0 :(得分:1)
是。您可以将DataProvider
的类名及其包指定为:
@Test(priority = 9, dataProvider = "refno", dataProviderClass=com.another.package.DataProvider.class)
public void searchAgain(String reffno)
通常应转换(因为完整的包路径可以移动到导入):
@Test(priority = 9, dataProvider = "refno", dataProviderClass=DataProvider.class)
public void searchAgain(String reffno)