zoukankan      html  css  js  c++  java
  • TestNG安装及配置

    1. 在idea中新建一个maven项目

    2. 在pom.xml中添加testng和reportng依赖

        <dependencies>
            <!-- 添加testNG依赖 -->
            <dependency>
                <groupId>org.testng</groupId>
                <artifactId>testng</artifactId>
                <version>6.11</version>
                <scope>test</scope>
            </dependency>
            <!-- 添加reportNG依赖 -->
            <dependency>
                <groupId>org.uncommons</groupId>
                <artifactId>reportng</artifactId>
                <version>1.1.2</version>
                <scope>test</scope>
                <!-- 排除testNG依赖 -->
                <exclusions>
                    <exclusion>
                        <groupId>org.testng</groupId>
                        <artifactId>testng</artifactId>
                    </exclusion>
                </exclusions>
            </dependency>
        </dependencies>

    3. 安装 Create TestNG XML插件(安装该插件可以右击项目自动生成testng.xml)

    两种方法:

      A. https://plugins.jetbrains.com/plugin/9556-create-testng-xml下载插件到本地

      在idea-File-Settings...  依次安装两个jar包

      

      安装dom4j-1.6.1.jar时会报错,可能是版本不兼容的原因,暂未找到解决办法

      

      B. 在线安装该插件

      

    4. 安装好后要求重启idea,重启好之后,右击项目,选择Create TestNG XML

    新建成功后,在项目根目录下生成testng.xml

  • 相关阅读:
    FTP Protocol
    File Operations
    Ubuntu Install Chinese Input Method
    Vim Intro
    ISA Introduction
    Fourier Transform
    Process/Thread Synchronization
    Process Synchronization-Example 2
    leetcode 栈和队列类型题
    leetcode 字符串类型题
  • 原文地址:https://www.cnblogs.com/janson071/p/9990111.html
Copyright © 2011-2022 走看看