Selenium IDE测试用例通过/失败

时间:2017-02-16 02:44:15

标签: selenium testing automated-tests selenium-ide

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

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

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

有人可以告诉我为什么吗?

2 个答案:

答案 0 :(得分:0)

测试可能会通过,因为您在点击后无法验证任何内容。

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

答案 1 :(得分:0)

嗨,使用selenium和testng框架编写测试用例结果通过/失败非常容易,请从下面的链接中读取我给出了明确的例子。

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

只需要为fileinput流和fileoutputstream类创建Excel实用程序,如下所示,并使用extends keyword将该类调用到另一个类

Excel Utility:

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);
}
相关问题