zoukankan      html  css  js  c++  java
  • [个人笔记] eclipse+appium+maven+testNG(reportNG)环境搭建

    本次使用的是eclipse

    刚开始用了IDEA+selenium+maven+reportNG的方式修改了pom.xml和testNG.xml

    但是有问题,然后网上查了各种pom.xml和reportNG的listener配置方法,然而途中出现各种错误,

    比如 maven-compiler-plugin:3.1 的问题、maven-surefire-plugin相关的问题,还有could not find listener class、找不到testng的class等等。。。

    最终还是在pom.xml说写死了所用的Java:

    --------------------------被人遗忘的分割线-------------------------

        <build>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-surefire-plugin</artifactId>
                    <version>2.14.1</version>
                    <configuration>

    <!--忽略运行test时错误-->
                        <testFailureIgnore>true</testFailureIgnore>

    <!--testNG.xml在项目根目录的res文件夹下-->
                        <suiteXmlFiles>
                            <suiteXmlFile>res/testNG.xml</suiteXmlFile>
                        </suiteXmlFiles>

    <!--生成报告所在目录-->

                        <workingDirectory>target/</workingDirectory>
                    </configuration>
                </plugin>

                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>3.1</version>
                    <configuration>
                        <verbose>true</verbose>
                        <fork>true</fork>
                        <executable>C:Javajdk1.8.0_121injavac</executable>
                    </configuration>
                </plugin>

            </plugins>
        </build>
    --------------------------被人遗忘的分割线-------------------------

    listener写在了testNG.xml里面:

    --------------------------被人遗忘的分割线-------------------------

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
    <suite
        name="Suite"
        parallel="false" >
        <test name="Test" >
            <classes>
                <class name="com.appium.testDemo.NewAPPTest" />
            </classes>
        </test>
     <!-- Test -->
    <listeners>
    <!-- 这是你需要加的东西 -->
    <listener class-name="org.uncommons.reportng.HTMLReporter" />
    <listener class-name="org.uncommons.reportng.JUnitXMLReporter" />
    </listeners>
    <usedefaultlisteners name="false" />
    </suite>

    --------------------------被人遗忘的分割线-------------------------

    后面想到再补充。

  • 相关阅读:
    JavaScript--函数、匿名函数和自执行函数详解
    HTML标签-----article、aside、figure、nav和section
    CSS文本(Text)属性-----letter-spacing和text-align
    CSS选择符-----伪类选择符
    JavaScript--元素对象方法setAttribute() 和appendChild()
    JavaScript--Document对象方法createElement()和createTextNode()
    Apache2.4使用require指令进行访问控制--允许或限制IP访问/通过User-Agent禁止不友好网络爬虫
    Null value was assigned to a property of primitive type setter of"原因及解决方法
    SQL SERVER中获取表间主外键关系
    解决Jboss中log4j在应用里面无法使用的问题
  • 原文地址:https://www.cnblogs.com/aikachin/p/7804921.html
Copyright © 2011-2022 走看看