triangle
arrow
Jenkins: Tutorial For Beginners

27-Feb-2018

By Harinder Kaur

Jenkins: Tutorial For Beginners

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

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.

Most Popular

Tech Talks With Benjamin Bischoff

16-Aug-2023 Tech Talks With Benjamin Bischoff
Read more

User Acceptance Testing: Unleashing The Power Of User Feedback

08-Aug-2023 User Acceptance Testing: Unleashing The Power Of User Feedback
Read more

Tech Talks With Marcel Veselka

03-Aug-2023 Tech Talks With Marcel Veselka
Read more

Interested to share your

QA Requirement!

Tags

  • jenkins tutorial for beginners
  • jenkins tutorials
  • Jenkins for testers
  • jenkins complete tutorial
  • jenkins for beginners
  • jenkins tutorial step by step
  • Sign up for newsletter !


    Comments

    No comments yet! Why don't you be the first?
    Add a comment

    Join our community
    of 1000+ readers.

    To get the latest blogs and techniques on software testing & QA Industry.

    *By entering your email, you subscribe to receive marketing uplates from Bugraptors.You can unsubscribe at any time. For more info, read BugRaptors Privacy Policy.