JENKINS+JAVA+ANT+SELENIUM+JUNIT4 deployment of continuous integration automated testing:
Environmental requirements:
(1) Jenkins
Download Jenkins.war package on official website. https://jenkins.io/
Run Jenkins.war to access http://localhost:8080/access Jenkins.
(2) Jdk
Download JDK on official website. http://www.oracle.com/technetwork/java/javase/downloads/index.html
Run the installation JDK and configure the environment variables. Java_home
(3) Ant
Download Apache ant.http://ant.apache.org/bindownload.cgi website
Run install Ant and configure environment variables. Ant_home
Deployment for continuous integration automated testing:
(1) Project code
Finish writing Java code, Unit test cases, ant-built build.xml files.
(2) Configuring Jenkins
Open the Jenkins home page.
Click System Management; Select Global Toolconfiguration
Select the JDK installation.
Alias: java_home, JAVA_HOME:JDK installation path. Cancel Automatic Installation
Select Ant installation.
Alias: ant_home, ant_home:ant installation path. Cancels the automatic installation.
Click New.
Create a new job and enter the item name. Choose to build a free-style software project and click "OK"
Configuration.
Enter the project name in general.
SOURCE Management: Select None
Build triggers:
build periodically: Cycle for project construction (it does not care if the source is changed)
Format: H 20 * * (represents one build per day 20:00)
Poll SCM: Regularly check the source changes (according to the SCM software version number), if there is an update checkout the latest code down, and then perform the build action.
Format: H/10 * * * * (indicates whether the source code changes every 10 minutes)
Build:
Click Add Build Step. Select Invoke Ant
Select Ant HOME in the ant version dropdown;
Targets input JUnit (Build.xml <!--execute test Case---Targetname= "JUnit")
Click Advanced to enter the absolute path to Build.xml in the build file. (Example: C:\Users\admin\Desktop\java automated test \test\build.xml)
Click Save to complete the basic configuration.
(3) operation
Click Build now to build, and click Console Output to view the running status.
If the status appears in accordance with the above diagram, the configuration is complete.