Selenium IDE 测试用例通过/失败

标签 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 上,它显示测试用例已经通过(它应该会失败)。

谁能告诉我为什么?

最佳答案

您好,使用 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

只需如下所示为文件输入流和文件输出流类创建 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/

相关文章:

javascript - TestCafe - 断言不起作用(测试的对象必须是数组等)

html - Linux上的跨浏览器测试

visual-studio - 运行多个类别的自动化测试

java - 专注于子窗口 - selenium

java - Selenium页面对象模型,如何将变量从一个页面类传递到另一个页面类?

java - 使用 Appium 运行 Web 应用程序自动化的步骤

python - Selenium Python 绑定(bind) : dealing with inconsistent modals

node.js - 如何使用 Node.js postgres 测试 CRUD 操作

selenium - 无法使用Selenium最大化Chrome窗口

java - 在Java中为属于同一组的测试定义@BeforeGroups方法的执行顺序