【问题标题】:Allure is not reporting failures properly with exception( nosuchelementexception )引诱没有正确报告失败异常( nosuchelementexception )
【发布时间】:2019-08-16 08:10:02
【问题描述】:
  1. krGlobalPage.softAssertionTestCall2(softAssertion); 必须在 krGlobalPage.softAssertionTestCall1(softAssertion); 失败后运行,因为

【问题讨论】:

    标签: java selenium testng allure


    【解决方案1】:

    我发现最好的方法 - 并且在 Allure 报告中显示为失败 - 是尝试捕获 findelement 并在 catch 块中,将 assertTrue 设置为 false,如下所示:

    try {
        driver.findElement(By.xpath("(//nav[@class='topline']//nav[@class='without-seperator1']/a)[1]");
    }catch(Exception e) {
        assertTrue(false, "Test Search link was not displayed");
    }
    

    【讨论】:

      猜你喜欢
      • 2015-04-02
      • 1970-01-01
      • 2014-07-15
      • 2016-05-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-06-07
      • 1970-01-01
      相关资源
      最近更新 更多