blogs

Jenkins: Tutorial for Beginners

Jenkins: Tutorial for Beginners 27 Feb,2018

What is Jenkins?

Jenkins is a very famous open source tool that performs continuous integration and delivery of projects. Nowadays most of the software companies use/integrate Jenkins into large number of deployment and testing technologies. The role of the Jenkins is to test and build the software continuously making it easier to identify the changes in the project. Using Jenkins, Continuous integration is achieved with the help of plugins. To integrate the needed tool, you just need to install the plugin for that particular tool.

How to start work on Jenkins?

If you don’t have Jenkins account firstly create a new account on Jenkins and then follow the below mentioned steps.

Login into Jenkins:

After installation, if you start Jenkins locally, go to “http://localhost:8080/login” URL. Note that the default port of Jenkins is: 8080.

If you have not set the credentials before Jenkins installation, then it will be:

Username: admin

Password: Go to your “C: \Jenkins\secrets\initialAdminPassword” for password

After login, you will be displayed “Welcome to Jenkins!” message.

How to Install Plugins in Jenkins?

Below are the steps to install SVN plugins in Jenkins:

# On the Dashboard, there is an option ‘Manage Jenkins’, click on it.

# In the next screen, select the Manage Plugins option and then click on Available tab.

# Listing of plugins will be displayed which are available for downloading.

# In the ‘Filter’ or search field type ‘SVN’.

# The available tab will be filtered out according to the searched text.

# Check the required plugins checkboxes.

# Click on the ‘Install without restart’ button.

# Check the checkbox ‘Restart Jenkins when installation is complete and no jobs are running’.

    OR

# Once all the installations are completed, restart Jenkins by issuing the following command in the browser ‘http://localhost:8080/jenkins/restart’.

# After restarting Jenkins, go to the Installed tab, and verify the downloaded plugins that should be under this tab.

How to Create New Job in Jenkins?

Follow the below mentioned steps:

# Click on Create new Job link on Jenkins dashboard screen.

# In the next Screen, Enter a name in Enter an item name textbox.

# Click on OK button.

# Click on Source Code Management tab.

# Check Subversion checkbox.

# Enter SVN path in Repository URL.

# Click on Add button to Credentials label.

# Click on Jenkins.

# Enter SVN Credentials.

# Click on Add button.

# After filling valid Repository URL and Credentials, Subversion tab will display without error.

# Now I will run the build. Following are the ways to run the build like: cmd, batch file, ant file, and direct entering the command in Build editor box etc. But here I will run the build from the Batch file.

# Create batch file (Reference link: http://www.seleniumeasy.com/testng-tutorials/how-to-run-testng-xml-via-batch-file-example).

# Put the created batch file in C:\Jenkins\workspace.

# Select Execute Windows batch command in Build section of Jenkins.

# Now enter the batch file path in Command text editor in the Build section of Jenkins.

# Click on Apply, and then Save.

# Click on Build Now on the left side of the screen.

# See the build in build history, if it is in Red color means it is FAIL while the Blue color indicates that it is PASS.

How to Send Email notification in Jenkins?

In Jenkins, we can send Build status email notifications to single and multiple recipients.

Single recipient:

# Enter the Recipient email address in Recipients textbox.

# Firstly, click on ‘Apply’ and then ‘Save’ button.

# Go to http://localhost:8080/configure.

# Enter SMTP server in E-mail Notification Section.

# Click on ‘Apply’ and then ‘Save’ button.

# Click on Build Now on the left side of the screen.

# See the build in build history, if it is in Red color means it is FAIL if it is in Blue color means it is PASS.

# Check the Recipient’s email account if he/she received the build status email notification.

Multiple recipients:

# Install the email-ext. plugin from Manage Plugins.

# Now add the multiple recipients in Recipients textbox as test@gmail.com, test1@gmail.com and so on.

# Click on ‘Apply’ and then ‘Save’.

# Go to ‘http://localhost:8080/configure’.

# Enter SMTP server in Extended E-mail Notification Section.

# Click on ‘Apply’ and then ‘Save’.

# Click on Build Now on the left side of the screen.

# See the build in build history, if it is in Red color means it is FAIL if it is in Blue color means it is PASS.

# Check the Recipients email account. They all should have received the build status email notification.

How to send Build.log file in email?

# Install the email-ext. plugin from Manage Plugins.

# Go to the ‘http://localhost:8080/configure’.

# Enter SMTP server in Extended E-mail Notification Section.

# Click on ‘Apply’ and then ‘Save’.

# Go to your projects configure page and Select Post-build Actions tab.

# Select Editable Email Notification.

# Now add the recipients to Project Recipient List text box.

# Click on Attach Build Log drop-down.

# Select Attach Build Log option.

# Click on Advanced Settings button.

# Click on Add Trigger drop-down.

# Click on Always option.

# Click on ‘Apply’ and then ‘Save’.

# Now Click on Build Now.

# Check Console output and received email.

 

Harinder Kaur Harinder works as Automation Test Engineer at BugRaptors. She is experts in writing scripts in web driver/Behat using Cucumber, gherkin languages. She has tested the web application on multiple Browsers and OS using Automation.

Your comment has been posted successfully!!

Leave a Reply

Your email address will not be published. Required fields are marked *

Name field is required !

12345 Rating field is required !

Related Posts

How To Use Jenkins Tool In Software Testing & What Are Its F...
Jenkins: Tutorial for Beginners

Jenkins is an open source tool which is simple, extensible, and user friendly. It performs continuous integration and provides CI services for appl...

Read More
How to select the Test Management tool for manual and automa...
Jenkins: Tutorial for Beginners

Test management is the process of tracking test cases, executing and documenting tests. A test management tool is used by QA teams and testers to mana...

Read More