zoukankan      html  css  js  c++  java
  • selenium+testng+reportng使用maven运行testng.xml不能生成测试reportng测试报告

    testng使用reportng     pom.xml配置

    <dependency>
    <groupId>org.testng</groupId>
    <artifactId>testng</artifactId>
    <version>6.14.3</version>
    <scope>test</scope>
    </dependency>
    <!-- 添加reportNG依赖 -->
    <dependency>
    <groupId>org.uncommons</groupId>
    <artifactId>reportng</artifactId>
    <version>1.1.4</version>
    <scope>test</scope>
    <!-- 排除testNG依赖 -->
    <exclusions>
    <exclusion>
    <groupId>org.testng</groupId>
    <artifactId>testng</artifactId>
    </exclusion>
    </exclusions>
    </dependency>
    <dependency>
    <groupId>com.google.inject</groupId>
    <artifactId>guice</artifactId>
    <version>3.0</version>
    <scope>test</scope>
    </dependency>
    <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>2.20</version>
    <configuration>
    <forkMode>once</forkMode>
    <argLine>-Dfile.encoding=UTF-8</argLine>
    <suiteXmlFiles>
    <suiteXmlFile>testng.xml</suiteXmlFile>
    </suiteXmlFiles>
    </configuration>
    </plugin>
    <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>2.20</version>
    <configuration>
    <properties>
    <property>
    <name>usedefaultlisteners</name>
    <value>false</value>
    </property>
    <property>
    <name>listener</name>
    <value>org.uncommons.reportng.HTMLReporter,org.uncommons.reportng.JUnitXMLReporter</value>
    </property>
    </properties>
    <!-- <workingDirectory>target/</workingDirectory>-->
    <forkMode>always</forkMode>

    testng.xml配置
    <listener class-name="org.uncommons.reportng.HTMLReporter"/>
    <listener class-name="org.uncommons.reportng.JUnitXMLReporter"/>

    ======================================================================

    idea中调试右击运行testng.xml可以正常生成reportng的报告,生成目录在test-output目录中,但是执行mvn clean test用例正常按照testng配置的执行,但是在test-output目录中就是找不到生产的reportng报告。最后发现不是没有生成reportng报告,而是生成在其他地方,target-surefire-reports-html下

  • 相关阅读:
    PyCharm常用快捷键
    在PyCharm中打开文件的位置
    使用Socket下载图片
    Python散列类型和运算符
    Python格式化输出和深浅复制
    爬虫的概念和会话
    Python数值类型和序列类型
    HTTP与HTTPS
    PyCharm彻底删除项目
    PyCharm永久激活
  • 原文地址:https://www.cnblogs.com/cjy-blog/p/14242832.html
Copyright © 2011-2022 走看看