October 8, 2015

Selenium Integration With Jenkins

In this post i am going to explain how to integrate with continuous integration tool Jenkins..

Prerequisites:
Here i am trying to run Maven project scripts so

  1. Maven Project with TestNG (you can go through this post  create-sample-maven-project.html)
  2. and few webdriver scripts
  3. Downlaod Maven Project from Here....
Download Jenkins:

1. Navigate ti http://jenkins-ci.org/
2. Download .war file

3. Save the jenkins.war file in any of the location, you need to run this Jenkins.war file.


Set Up Jenkins:

1. Navigate to folder where you kept your jenkis.war
2. type command java -jar jenkins.war and press Enter

3. Will take some time to extract Jenkins, then you will get a success message.
4. By default Jenkins will start in port number 8080
5. For Jenkins UI use this URL in browser http://localhost:8080/



Configure Jenkins:

Before creating any Jenkins job we need to perform some configuration steps.
1. Click on Manage Jenkins link on the left side of the page
2. Click on Configure System.
3. Navigate to JDK section and Click on Add JDK button
4. Uncheck Install automatically check box so Jenkins will only take java which we have mention above
5. Give the name as JAVA_HOME and Specify the JDK path


6. Add Maven. IF you already not downloaded maven, get it from here Download Maven


6. Click on Save button.


Create Jenkins Job:
1. Click on create new Jobs.
2. Enter Job description and select Maven Project
3. Go to Build section and Enter path of POM.xml in ROOT POM text box.
4. Click apply and Save,



Run Job:
Navigate to Home page of Jenkins, there you can see new Job is created. Click on Build now symbol

Maven will build the project. It will then have TestNG execute the test cases
Once the build process is completed, in Jenkins Dashboard click on the Job1 project






11 comments:

  1. Thanks for sharing great information in your blog. Got to learn new things from your Blog . It was very nice blog to learn about Selenium

    ReplyDelete
  2. Are you trying to make cash from your traffic by popup advertisments?
    If so, have you tried using Pop Ads?

    ReplyDelete
  3. Good information about selenium

    ReplyDelete
  4. Nice article about the selenium.People willing to get the indepth knowledge in getting framework such as TestNG,jenkins,Maven and POM should get properly get best selenium training in chennai

    ReplyDelete
  5. It’s great to come across a blog every once in a while that isn’t the same out of date rehashed material. Fantastic read.
    I’ve bookmarked your site, and I’m adding your RSS feeds to my Google account.
    selenium training in bangalore

    ReplyDelete
  6. I am really happy with your blog because your article is very unique and powerful for new reader.
    Selenium Training in Chennai

    ReplyDelete