当我执行我的 Testng 代码时,总是会跳过测试。我收到以下错误
FAILED CONFIGURATION: @BeforeTest beforeTest
在我的代码片段下面
@Test(dataProvider = "bhaskar")
public void f(String xpath,String values,String action,String browser) {
if(browser.contentEquals("common")) {
switch(action) {
case "openurl" : openurl(values); break;
case "verifytitle": verifytitle(values); break;
case "click": click(xpath); break;
default: System.out.println("keyword not found");
}
}
}
//-------------------------------------
public void openurl(String values) {
driver.get(values);
}
public void verifytitle(String values) {
String title=driver.getTitle();
Assert.assertEquals(title, values);
}
public void click(String xpath){
driver.findElement(By.xpath(xpath)).click();
System.out.println("clicked");
}
@DataProvider(name="bhaskar")
public String[] dp() {
String[] a=new String[] {"","w3schools.com/","openurl","common" };
return a;
}