【问题标题】:How to add stacktrace in reportng (html file) for passed tests?如何在 reportng(html 文件)中添加堆栈跟踪以通过测试?
【发布时间】:2019-10-16 09:09:06
【问题描述】:

我正在以 TestNGSuite 的身份执行我的测试。我从 testng.xml 运行,我在其中放置了所有测试和两个侦听器,例如

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">

<suite name="ufe-klient" verbose="1" parallel="tests" thread-count="1">

<listeners>
    <listener class-name="org.uncommons.reportng.HTMLReporter" />
    <listener class-name="org.uncommons.reportng.JUnitXMLReporter" />
</listeners>

    <test name="Addresses" >
        <classes>
            <class name="com.individualclient.Addresses"/>
        </classes>
    </test>

当我有错误情况时完成测试后是好的。在 index.html 文件中,我有堆栈跟踪,其中显示的步骤不执行。在我的测试通过的另一边,我在 sacttrace 中什么都没有。只有绿色复选框、路径和测试名称。我应该怎么做才能在通过的测试中显示堆栈跟踪?

【问题讨论】:

    标签: selenium selenium-webdriver testng reportng


    【解决方案1】:

    在beforesuite下面添加

    htmlReporter = new ExtentHtmlReporter(System.getProperty("user.dir") +"/test-output/testReport.html");
    
    
      //initialize ExtentReports and attach the HtmlReporter
      extent = new ExtentReports();
      extent.attachReporter(htmlReporter);
    

    参考文章

    https://www.seleniumeasy.com/selenium-tutorials/creating-extent-reports-in-selenium-example

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-02-09
      • 2021-09-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-03-03
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多