eclipse - ReportNG 带有 TestNG 的报告不是使用 WebDriver 生成的

标签 eclipse webdriver automated-tests testng reportng

我在 Eclipse 中使用 Selenium WebDriver + TestNG 和 java。我想使用 ReportNG 生成更好的报告,而不是普通的 TestNG 报告。我已经使用reportng-1.1.2.jar和velocity-dep-1.4.jar配置了构建路径。我还从“项目”>“属性”>“TestNG”>“禁用默认监听器”禁用了默认 TestNG 报告 目前,我已经创建了一个 testNg.xml 文件,该文件将我的测试作为完整的测试套件运行。 xml文件内容如下:

<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite thread-count="5" skipfailedinvocationCounts="false" verbose="1" preserve-order="true" name="testingXML" junit="false" parallel="false" annotations="JDK">
<test verbose="2" name="com.src.com.pcrm.pageobjects.*" junit="false" annotations="JDK">
<testng classpathref="test-path"
            outputdir="${test-results.dir}"
            haltonfailure="true"
            useDefaultListeners="false"
           listeners="org.uncommons.reportng.HTMLReporter,org.uncommons.reportng.JUnitXMLReporter">
      <xmlfileset dir="." includes="testng.xml"/>
      <sysproperty key="org.uncommons.reportng.title" value="My Test Report"/>
    </testng>
<classes>
<class name="com.pcrm.pageobjects.HomeTest"/>
    <methods>   
        <include name="testManadatoryFieldsOnHomePage"/>
        <include name="testIsLogoDisplayed"/>
        <include name="testUrlCheck"/>
    </methods>

但是当我执行这个 xml 文件时,它没有生成任何 ReportNG 报告。有什么问题吗?感谢帮助。

最佳答案

我最好的猜测是这是一个类路径问题。确保 ReportNG 和 Velocity JAR 位于类路径上。看这个related question有关使用 ReportNG 和 Selenium 的类似问题。

关于eclipse - ReportNG 带有 TestNG 的报告不是使用 WebDriver 生成的,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12948907/

相关文章:

eclipse - golang 与其他语言的 Goclipse 工作区

javascript - WebDriver/Java中如何点击子元素

python - Selenium/Webdriver 的 python 绑定(bind)中的 get_Text() 等价物是什么

ios - 这部分在 iPhone 屏幕上叫什么?想用它来决定屏幕是否是主屏幕

windows - 如何使用 Windows 容器进行软件测试?

Java Servlet RandomAccessFile 错误

eclipse - Lint : How to ignore "<key> is not translated in <language>" errors?

java - 我如何告诉远程调试器在某个时候实际挂起?

java - 如何通过 Selenium 和 Java 单击“停用”按钮,然后单击“激活”按钮

c# - 集成测试 : Am I doing it right?