Turn from:
http://blog.csdn.net/tulituqi/article/details/17846463
Why should we introduce RF? In fact, we initially introduced RF to be able to quickly carry out automated acceptance testing, for the agility escort. This one of the important tools Jenkins, but also the requirements of friends in the group, this time to introduce how RF fast and convenient combination of Jenkins this tool in the automated testing on Windows (Linux I do not have a machine, the general steps almost, the degree Niang should have).
Actually personally feel that the combination of RF and Jenkins is very simple, summed up on these points:
1. Download Jenkins
2. Adding nodes
3. Install Robotframework plug-in
4. Configure Job Run test
If you are already using Jenkins, you should be able to skip 1 or 2 points. Because the poor road is lazy, so the recommendation is lazy Dafa, OK, let's start.
First, Download Jenkins
: http://mirrors.jenkins-ci.org/
Poor road comparison recommended to download the war package, enter the address above, the page has a war link, various types of release, everyone according to their own needs to download it, the specific meaning of the English Niang.
If there is no special requirement for the Jenkins version, go to the first line of the war release to find the latest version.
Why is the war package the simplest? If you have Tomcat, then put the war pack in his WebApps directory and start your Tomcat directly.
The usual access path is Http://localhost:8080/jenkins
If you don't have Tomcat, it's even easier, I won't teach you how to install Tomcat,jenkins's war package built-in jetty, we can start it directly with the command line Java-jar Jenkins.war. Such as:
Of course, I recommend this way, because the jetty way directly to allow others to access, you can see the 5th line of the address 0.0.0.0:8080, directly turn the machine into a server.
In Tomcat, you also modify the configuration IP to 0.0.0.0. So it's a lot easier for lazy people like me.
When you see a line of information: Jenkins is fully up and running, the service on behalf of Jenkins has started.
We recommend you to visit in Chrome, the speed will be faster, open our Jenkins Address: http://192.168.1.6:8080 (IP based on your native IP, also available localhost, compared to tomcat, the URL does not have to write Jenkins) , you'll see a page like this:
Such a basic Jenkins is finished, very simple, a command line to get it done.
Of course, there are a lot of plugins will make us more convenient to use Jenkins, but this is not my article to talk about the content, there is a need to self-degree Niang, just download the war page has a plugin link is plug-in.
I recommend a few common plugins:
Ant, Dashboard-view, Disk-usage, subversion, and so on, now Jenkins more mature, plug-ins are also a variety of, find suitable for their own use of plug-in installation bar.
Second, add the node
The machine in which we start the Jenkins service is called Master in Jenkins, while the other machines that connect to master (physical, virtual) are slave, also known as nodes.
1, click on the System management, and then click on the Management node, you can see the following interface:
2. Click New node
(This is the way of static connection, that is, I first set up the node, by slave himself to connect master as the node.) There is also a way of dynamic connection, without first set up a good node, directly with Slave.jar, here is not detailed introduction)
3, enter the name of the slave, click OK
There are a few points to note that I have highlighted:
A, executors: Indicates that several threads can be executed in parallel on the slave, or you can click the question mark at the back to see the description. For RF, the recommended setting is 1.
b, remote working directory: Create the path to the Jenkins working directory on Slave, I am generally set to D:\JK
C, Label: You can add one or more labels to slave, select slave by tag
D, Start method: Start Slave method, recommend the second launch slave agents via Java Web start
Note: If the slave is used to perform RF automation test cases, the choice of Windows service is strictly prohibited, otherwise the consequences are at your own risk.
We add 2 tags to this slave slavea and Slaveall (the name of the node slave1 can also be counted as tags), set the point to save.
There are a number of ways to start slave, choose one to start it, recommend 2. Then we add a slave2, the label with SLAVEB and Slaveall, there are machines can find two of their own to connect, no words on their own this machine can also be when the slave to come up, so that their machine and when the master and slave, practice it doesn't matter.
That's how I got it.
Third, install Robotframework plug-in
Next we want to install plug-ins, most of the plug-in installation methods are similar, mainly introduce one of them.
1, go back to the Jenkins home page, enter the system management, click the management plugin
There are updatable, optional plugins, installed and advanced pages.
Can be updated and installed nothing to say, optional plug-in lists all the plug-ins and simple introduction, click on his connection can go to the plugin's homepage, which has a detailed introduction.
2, we mainly use or advanced this page of the upload plugin this part:
Here we need to upload the HPI file of the plugin, wait for his prompt installation to complete, then restart Jenkins to complete the installation.
To the beginning I give the Address page can find plug-ins, here directly provide the RF plug-in Download path http://mirrors.jenkins-ci.org/plugins/robot/
RF Plug-in version is recommended 1.3.2, if you encounter the problem of parsing XML error, you can join the QQ group, there is a fixed version.
Iv. Configuring Job Run Tests
The next step is to configure the job.
1, on the homepage has prompted us to create a new task, or point to the left of the new link can also go to the new task page.
For the RF job, the free style is available. Multi-configuration is also possible, just a little more than the configuration of inconvenient, see each need it, for example, you want to put a case in a number of different configurations of the slave, you can use a multi-configuration job.
2, first to introduce the free style, click OK, then go to the Job Configuration page.
There are a lot of places to be configured, so we can quickly execute the case first to introduce several places that must be set up.
A, Restrict where this project can be run: The preceding label is used here. Used to specify the label on which the job is executed on the slave. The specified slave label for multiple configuration items is not here, the next one will speak.
B, source management: RF case recommended to use SVN, this demo does not do the processing, the next one will be simple to say.
C, build: We want to increase the build step-execute Windows Batch command, I first write a simple command, the full command line parameters of the people themselves in the command line input Pybot.bat--help see
D, post-build operation: We want to increase the post-build step-publishes Robot Framework test results, the first output default can be empty, If the previous pybot.bat specified the output directory, then the corresponding settings here, otherwise he could not find output.xml can not parse the results.
3. Then click Build now to run the job.
You can click the build progress bar to see the console output directly, or the name of the point build in the menu to find the console output to see the results.
4, the role of RF plug-in
RF plug-ins mainly used to parse the RF running Output.xml file, the results of the analysis show.
A, on the first page of Jenkins display job The latest build results, see the last column robot Results
b, in the Job's home page will show the running results of the trend map
OK, the content of this article is mainly about these, is limited by the space, this is mainly to allow you to quickly start building Jenkins and can be combined with RF to run our automated test case. In the next article, I'll give you some details about what I missed.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Jenkins Environment Setup