What is Jenkins?

Jenkins is a very famous open-source tool that perform continuous integration and delivery of projects. Nowadays most software companies use/integrate Jenkins into a large number of deployment and testing technologies. The role of 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 a 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 the “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 a "Welcome to Jenkins!" message.

jenkins screenshot

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 the Available tab.

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

# 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.

tutorial

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 entering an item name textbox.

# Click on the OK button.

# Click on the Source Code Management tab.

# Check Subversion checkbox.

# Enter SVN path in Repository URL.

# Click on Add button to the Credentials label.

# Click on Jenkins.

# Enter SVN Credentials.

# Click on Add button.

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

code management

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

# Create a 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 the 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 colour means it is FAIL while the Blue colour 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 the Recipients textbox.

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

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

# Enter SMTP server in E-mail Notification Section.

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

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

# See the build-in build history, if it is in Red colour means it is FAIL if it is in Blue colour 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 colour means it is FAIL if it is in Blue colour 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 the Project Recipient List text box.

# Click on Attach Build Log drop-down.

# Select Attach Build Log option.

# Click on the Advanced Settings button.

# Click on Add Trigger drop-down.

# Click on the Always option.

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

# Now Click on Build Now.

# Check Console output and received the email.

Also Read: Jenkins for Software Testing and its Features

author_image

Sandeep Vashisht

Sandeep Vashisht is the Manager – Quality Assurance at BugRaptors. With experience of more than 15 years, Sandeep specializes in delivering mobile, web, content management, and eCommerce solutions. He holds a strategic QA vision and has the ability to inspire and mentor quality assurance. He is an expert with a grip on project plan development, test strategy development, test plan development, test case & test data review.

Comments

Add a comment

BugRaptors is one of the best software testing companies headquartered in India and the US, which is committed to catering to the diverse QA needs of any business. We are one of the fastest-growing QA companies; striving to deliver technology-oriented QA services, worldwide. BugRaptors is a team of 200+ ISTQB-certified testers, along with ISO 9001:2018 and ISO 27001 certifications.

USA Flag

Corporate Office - USA

5858 Horton Street, Suite 101, Emeryville, CA 94608, United States

Phone Icon +1 (510) 371-9104
USA Flag

Test Labs - India

2nd Floor, C-136, Industrial Area, Phase - 8, Mohali -160071, Punjab, India

Phone Icon +91 77173-00289
USA Flag

Corporate Office - India

52, First Floor, Sec-71, Mohali, PB 160071,India

USA Flag

United Kingdom

97 Hackney Rd London E2 8ET

USA Flag

Australia

Suite 4004, 11 Hassal St Parramatta NSW 2150