一、安装jdk。
jdk下载地址:http://www.oracle.com/technetwork/java/javase/downloads/index.html
具体环境配置见:Jmeter安装及环境配置
二、Maven安装、环境配置
1、Maven下载:http://maven.apache.org/download.cgi
2、Maven环境配置
1>在系统变量内添加环境变量 M2_HOME(或者MAVEN_HOME),值为解压后的目录,如C:Program FilesJavaapache-maven-3.3.3.
2>在系统变量内Path中添加%M2_HOME%in
3>win+R,运行cmd命令行:mvn -v 检查是否安装成功,如下图即成功!
三、准备Intellij IDEA开发工具
Intellij IDEA开发工具破解见:http://www.cnblogs.com/lxj-dream/p/8653473.html
四、在Maven项目中添加Selenium和TestNG相关jar包的依赖
1. 在IDEA中新建一个Maven项目。
2.搜索到以下相关jar包的group ID, artifact ID, version等相关信息,并将此添加到pom.xml文件的dependencies中(项目中使用到的其他jar包也可至该网址上搜索到并添加至pom.xml文件):
Selenium-firefox-driver, selenium-chrome-driver, selenium-ie-driver, selenium-support, testng
<!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-chrome-driver --> <dependency> <groupId>org.seleniumhq.selenium</groupId> <artifactId>selenium-chrome-driver</artifactId> <version>3.11.0</version> </dependency> <!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-firefox-driver --> <dependency> <groupId>org.seleniumhq.selenium</groupId> <artifactId>selenium-firefox-driver</artifactId> <version>3.11.0</version> </dependency> <!-- https://mvnrepository.com/artifact/org.testng/testng --> <dependency> <groupId>org.testng</groupId> <artifactId>testng</artifactId> <version>6.14.2</version> <scope>test</scope> </dependency> <!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-support --> <dependency> <groupId>org.seleniumhq.selenium</groupId> <artifactId>selenium-support</artifactId> <version>3.11.0</version> </dependency>