Selenium IDE 测试用例通过/失败

Selenium IDE Test Case Pass / Fail

我是新手 Selenium IDE。我正在编写这个测试用例,其中用户 A 单击此 link 然后它应该将用户定向到正确的页面。不幸的是,页面 returns:

An error occured. Message: script 'pp/agensi-list.phtml' not found in path (C:/htdffocs/star/application/views\scripts/**)

但是在我的 selenium 上,它显示测试用例已经通过(应该会失败)。

谁能告诉我为什么?

测试很可能通过,因为您在点击后没有验证任何内容。

如果在单击 link 后测试停止,那么它将通过。你必须确认发生了什么事。在 CSS 中寻找变化,或者甚至寻找上面列出的消息?

您好,使用 selenium 和 testng 框架编写测试用例结果非常容易 pass/fail,请阅读下面的内容 link 我已经给出了清晰的示例。

How can I write Test Result (Pass/Fail) in Excel file using TestNG Framework with Selenium WebDriver?

更多实时示例,您可以阅读write test case pass/fail in excel using testng

只需为文件输入流和文件输出流 classes 创建 Excel 实用程序,然后使用 extends 关键字 [=] 将 class 调用到另一个 classes 14=]

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
}
}

另一个class:

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);
}