Professional Documents
Culture Documents
Jenkins SetUp
Jenkins SetUp
Introduction.............................................................................................................................................3
Jenkins installation..................................................................................................................................4
Jenkins Configuration..............................................................................................................................5
Jenkins master and slave.........................................................................................................................7
Setting up a Jenkins job for Latte..........................................................................................................11
Report analysis......................................................................................................................................15
Introduction of Jenkins Introduction
Jenkins is the tool used for continuous integration concept where we can build and test
software projects continuously and it monitors the executions of jobs. Jenkins keeps the
outputs and makes it easy for you to notice when something is wrong, which helps achieve
the continuous integration solution to provide executives, managers, developers and
architects a better sense of the development progress and code quality throughout the
project lifecycle.
1. Native package: Installs Jenkins as backend service which runs all the time in back
end.
a. Download executable file from https://jenkins-ci.org/ as per the OS.
b. Install Jenkins on the OS.
i. Windows :- http://mirrors.jenkins-ci.org/windows/latest
ii. Mac :- http://mirrors.jenkins-ci.org/osx/latest
iii. Linux(Ubuntu/Debian) :- http://pkg.jenkins-ci.org/debian/
c. Then in browser got to http://localhost:8080.
d. It will display the Jenkins web UI.
2. Java Web Archive (.war): Jenkins can be started manually by using the command
“java –jar Jenkins.war” in the command prompt or terminal (Linux).
a. Download the .war file from http://mirrors.jenkins-ci.org/war/latest/jenkins.war
b. In the command prompt or Terminal, change your current working directory
to the folder where Jenkins war file is downloaded.
c. Run the command “java –jar Jenkins.war” to start Jenkins and let it set
Jenkins home automatically.
Once manage Jenkins clicked it will navigate to “Manage Jenkins” page which will have
many options to configure.
Basic configurations are:
1. Configure System: It is used to configure the system and tool configuration like Git,
java, Gradle…etc. Click on Global Tool Configuration and add jdk file path.
We provide the location of the tools installed in the system, So that Jenkins can
access to them when required.
2. Configure Global Security: it defines the security for accessing the Jenkins and user
Authorization.
3. Manage Plugins: Here we install plugins which are required for our project like
TestNG, Gradle, and Pipelines…etc. Add Publish HTML Reports and TestNG
plugins manually.
6. If you want the service to run on start-up of the slave machine do the following
(Windows only directions):-
a. In the Slave agent program running on your slave machine,
b. Click File --> Install as Windows Service.
7.
Setting up a Jenkins job for Latte
Pre-requisite: -
a. Place Selenium Grid related files under “C:\LATTE_GRID”
b. Start “server.bat” first and then “GRID_NODES.bat” to make Sure Selenium Grid is up
and Running.
c. Now Place\download “Smart Eye application” to any specific location which can be
accessible from Jenkins (best place is: “C:\Latte-executables”). And Latte application
dependent files will be stored\downloaded in Jenkins job workspace.
2. Afterwards enter a name for the job and select Freestyle Job. Press OK to create a new
Job in Jenkins. The next page allows you to configure your job. If we are using GitHub,
then enter the URL to the Git repository. And we can do other job related setting Like
Gradle, TestNG…etc.
3. Specify where to run the job, Ex: Jenkins master or other Jenkins nodes.
4. Next, Select Jenkins Batch or PowerShell Plugin in BUILD stage to give Latte
commands for execution. And enter the command:-
a. CMD: "c:\SmartEye.exe" -host localhost -port 8885 -ConfigFile configJSON.json -ProjectLocation
"Demo-Scripts.lat" -execute
b. PowerShell: & 'C:\Latte-executables\LATTE CLI 6.0.3.exe ' -host localhost -port 8885 -
ConfigFile configJSON.json -ProjectLocation "Demo-Scripts.lat" -execute
5. Once execution setup is done, we can configure how our Report should be published.
This can be setup in “Post Build Actions”. We can use two ways to publish them: -
NOTE- Make sure you have installed below two plugins manually. s
a. HTML Publish: This plugin will Process the HTML report file generated by
Latte after execution. Last Html Report Location can be set in the Latte CLI
Json file and that location can be used below.
b. TestNG: This will Process TestNG Reports and Make the Job Pass, Unstable
and Fail based on the execution reports.
6. Now click on “Save button to save the job”. Once saved job will be displayed in Jenkins
job section.
7. When we click on the job name, it will take us to job page. On the job page click on
“Build now” to start the execution.
8. Once job execution started we can see build number under build history.
On clicking on the build number. It will take us to the build details page where we
can see build related details.
If we wish to see the Console of the Execution, we can click on “Console Output”.
9. To stop the job execution we can click the (x) button on the job progress.
10. To delete the job we have to click the ‘delete project’ and then select yes.
Report analysis
1. HTML Report: To View the HTML Report of Latte we can click on “HTML
Report” under the Job.
This will take us to the HTML Report Page. Where we can see the Latest HTML
Report. On clicking “Back to jobname”, will take us back to job page.
2. TestNG Report: TestNG Reports are used for Marking Build as Pass, Unstable or Fail
based on the Results. Graph of the TestNG will be displayed under Job page.