Jenkins Continuous Integration Automated test configuration

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.