我是 Selenium IDE
的新手。我正在编写这个测试用例,其中用户 A 单击此链接,然后它应该将用户定向到正确的页面。不幸的是,页面返回:
An error occured. Message: script 'pp/agensi-list.phtml' not found in path (C:/htdffocs/star/application/views\scripts/**)
但是在我的 selenium 上,它显示测试用例已经通过(它应该会失败)。
谁能告诉我为什么?
最佳答案
您好,使用 selenium 和 testng 框架编写测试用例结果通过/失败非常容易,请阅读下面的链接,我已经给出了清晰的示例。
更多实时示例,您可以阅读write test case pass/fail in excel using testng
只需如下所示为文件输入流和文件输出流类创建 Excel 实用程序,并使用 extends 关键字将该类调用到另一个类中
Excel 实用程序:
public class Excelutility {
@BeforeTest
public void exceloperation(){
FileinputStream file = new FileiinputStream("file path");
//do file input stream details here
Fileoutputstream newfile=new Fileoutputstream("filepath");
//do fileoutputstream details here like create workbook,create sheets etc
}
}
另一个类:
public class operations{
@Test
public void openbrowser(){
//write driver operations here
//write excel operations using
if(Title.equalsIgnoreCase("HP Loadrunner Tutorial")){
Testcase="PASS";
}else{
Testcase = "FAIL";
}
Label l1=new Label(1,2,"status")
writablesh.addCell(l3);
}
关于Selenium IDE 测试用例通过/失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42263893/