Selenium2+python automation 62-jenkins continuous integration environment construction

foreword

After the selenium script is written, it is generally integrated into the jenkins environment, which is convenient for one-click execution.

 

1. Environmental preparation

Xiaobian environment:

1. win10 64 bit

2.JDK 1.8.0_66

3.tomcat 9.0.0.M4

4.jenkins 2.0

 

2. Install JDK

1. There are a lot of JDK installation tutorials, so I won't talk about them here. You can refer to the tutorials in this link: JDK installation and configuration tutorial_Baidu Experience

Add the following variables to the system environment variables:

①JAVA_HOME: jdk installation path C:\Sun\Java\jdk

②CLASSPATH:“.;%JAVA_HOME%\lib;”

③Path:“;%JAVA_HOME%\bin”

2. Check if the environment is successful (this step is very important)

>>java -version

>>javac

(Enter javac to see these contents in Chinese)

 

Second, the tomcat environment

1. Open the Baidu webpage, enter the key sub: tomcat in the Baidu search bar, and click the tomcat official website to download in the query results. (The software must be downloaded from the official website, don't mess up, be careful to plug the Trojan horse)

2. The installation process is also available online: How to download and install tomcat and how to configure environment variables Develop Paper

3.tomcat environment variables

Add the following variables to the system variables Windows 7 system installation and configuration Tomcat server environment Develop Paper

1) Create a new TOMCAT_HOME variable

variable name TOMCAT_HOME

Variable value d:\tomcat

The variable value is the tomcat decompression path we downloaded, here mine is d:\tomcat

 

2) Create a new CATALINA_HOME variable

Variable name CATALINA_HOME

Variable value c:\tomcat

Yes, the variable value of CATALINA_HOME is the same as the variable value of TOMCAT_HOME.

 

3) Modify the variable Path

Find the Path variable name in the system variables, double-click or click to edit, and add the following at the end

;%CATALINA_HOME%\bin;%CATALINA_HOME%\lib

It should be noted here that each variable value must be separated by ;.

 

3. Start tomcat

1. Start the Tomcat server

Enter startup.bat in the cmd command window and press Enter, run as shown below

(You don't need to switch to the directory after installing the environment variable)

2. Double-click to start running

3. After Tomcat is successfully started, start the browser and enter: http://localhost:8080/ in the address bar of the browser. Then enter. Enter the following screen. At this point, it means that Tomcat has been installed correctly

 

Fourth, the jenins environment

1. There are two types of Jenkins packages:

One is the setup.exe client package (this double-click is the same as installing QQ, so I won't say it)

One is the war package

2. Put the war package under webapps

 

3. Start jenkins

First restart tomcat: startup.bat, then enter http://localhost:8080/jenkins/ in the browser

 

Five, configure jenkins

1. Create a new job

2. Enter the project name

3. Build the trigger

4. Configure the cmd command

 

5. Select the project to execute with one click and start the automation

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325473138&siteId=291194637