intelliJ+maven+自动化测试

intelliJ+maven

  1. 下载安装intelliJ,maven 教程:https://blog.****.net/ck4438707/article/details/53377413
  2. 将pom 导入maven工程,可使用搜索maven工程,设置maven安装的对应的路径。将setting.xml中的repository设置为自己本地的仓库。
  3. 在file-other setting-project structure里设置对应的JAVA JDK 版本,
  4. 设置完成后则环境搭建完毕。
    intelliJ+maven+自动化测试intelliJ+maven+自动化测试
    intelliJ+maven+自动化测试
    其中pom.xml为配置文件,就是通过pom.xml文件的配置获取jar包,而不用手动去添加jar包。
    比如你想使用selenium API,在pom.xml中加入下面代码:
<dependency>
        <groupId>org.seleniumhq.selenium</groupId>
        <artifactId>selenium-java</artifactId>
        <version>2.44.0</version>
</dependency>  

intelliJ+maven+自动化测试
添加TestNG库:

<dependencies>
        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>6.8.7</version>
            <scope>test</scope>
        </dependency>
</dependencies>