Google+

How to install Jenkins for Selenium from Command line ?

To achieve Continuous Integration in Test Automation, we have to use a tool known as Jenkins.

With the help of Jenkins, we can continuously execute the Selenium Automation scripts on a daily basis.

In this post, I will explain the process of Installing the Jenkins from Command line.



Follow the below steps for installing Jenkins from Command Line:

1. Before installing Jenkins, browse localhost:8080 in any browser and make sure that nothing got loaded onto the page as shown below:

Note: "This site can't be reached" needs to be displayed.



2. Also make sure that Java 7 or 8 is installed on your machine as shown below:

Without installing above Java versions, we cannot install / use Jenkins.

Note: Open command prompt and execute the command 'java -version' to find the Java version installed on your machine.



3. Open https://wiki.jenkins.io/display/JENKINS/Meet+Jenkins in any browser , scroll down to "Installation" section and click on 'download jenkins.war' option as shown below:



4. jenkins.war will be downloaded from your browser as shown below:


5. Copy the downloaded jenkins.war file and paste it in to any folder say 'C' Driver as shown below:



6. Select the 'C' drive on your machine as shown below:



7. While the 'C' drive is selected, press and hold the 'Shift' key on your keyboard and right click using your mouse to get the "Open command window here" option as shown below:

Note: Select the "Open command window here" option.



8. On selecting the 'Open command window here" option from the above screen shot, the command prompt will be displayed with the default path set to "C" drive as shown below:



9. Execute "java -jar jenkins.war" in the command prompt and observe that the details shown in the below screenshot will be displayed in the command prompt:



10. Now open the same localhost:8080 in any browser and observe that the Jenkins related information will be displayed on the screen as shown below:

Note: The below screen shot confirms that the Jenkins is installed on your machine.



11. Copy the path displayed on the "Getting Started" screen of Jenkins as shown below:



12. Open the above copied path in the Folder explorer as shown below:



13. Right click on the 'intialAdminPassword' and select to open the file in Notepad as shown below:



14. Copy the password displayed in the opened file as shown below:



15. Paste the above copied Password into the "Unlock Jenkins" page and click on 'Continue' as shown below:



16. Click on "Install suggested plugins" option as shown below:



17. "Getting Started" screen will be displayed and all the plug-ins shown below will be installed one by one as shown below:



18. Once all the plug-ins got installed, "Create First Admin User" screen will be displayed and provide all the required details and click on 'Save and Finish' button as shown below:



19. Observe that the Jenkins will be ready to use as shown below and click on 'Start using Jenkins' to get started



20. Observe that Jenkins dashboard will be displayed as shown below and you are all set to use Jenkins:



Hence by following the above steps, we can install the Jenkins in our machines from command line.

Instead of installing Jenkins from Command line, if you want to download and install it using the .exe file, refer to the below post:

No comments: