Automate the JMeter interface
Using JMeter to implement basic interface automation testing, the main process is divided into the following 4 steps:
- Install JMeter (JDK, configure environment variables)
- Prepare JMeter script
- Install ANT and Jenkins helper tools
- Execute the script through the build build of the ANT tool, associate with building a scheduled task on Jenkins and generate a test report
First, prepare the JMeter environment, JDK1.8, and configure environment variables
JMeter download address: Apache JMeter - Download Apache JMeter
JDK download address: Java Downloads | Oracle
The JMeter I installed is 5.4.1, which requires jdk1.8 or higher. If you use 1.7 or lower version of jdk, you can find a lower version of JMeter to install
2. Configure JMeter environment variables
JAVA_HOME: C:\Program Files\Java\jdk1.8.0_251 (copy the path on which disk jdk is installed on)
Path: %JAVA_HOME%\bin;%JAVA_HOME%\jre\bin
Classpath: %JAVA_HOME%\lib\dt. jar;%JAVA_HOME%\lib\tools.jar
Environment variable Baidu has a bunch of articles, just follow the configuration
The win+R shortcut key opens the cmd window, enter cmd, and type the java –version command, if you can get the following output, it means the configuration is correct
3. Install ANT
ANT download address: Apache Ant - Binary Distributions
Configure apache-ant environment variables
The win+R shortcut key opens the cmd window, enter cmd, and type the ant –version command, if you can get the following output, it means the configuration is correct
4. Install Jenkins
Jenkins download address: Jenkins
The msi file I downloaded, double-click to install
After the installation is complete, I found the jenkins.exe file in the installation path and double-clicked it to start
Enter the address on the browser: localhost:8080/login?
The first time you open it, you may need to unlock Jenkins and copy the above path
Open it in notepad or notepad, copy the password
Note that after copying the password, copy the address localhost:8080 to the browser to open
At this point, JMeter+ANT+Jenkins is built successfully