SELENIUM BASICS:

  • What is Automation Testing - Advantages & Types of Tools
  • What is Selenium IDE, Selenium RC, Selenium WebDriver, Selenium Grid?
  • Selenium IDE, Firebug & Firepath Installation

  • SELENIUM WEBDRIVER:

  • Selenium WebDriver Architecture
  • Selenium Installation
  • Challenges and Limitations of Selenium
  • First Selenium WebDriver Script
  • Working with Firefox Browser
  • Solution - Failed To Launch Browser Using Selenium WebDriver
  • Working with Chrome Browser
  • Working with IE Browser
  • Difference Between FindElement & FindElements
  • Install Firebug, Fire path and other add on for Selenium
  • Locators in Selenium
  • Dynamic Xpath
  • Dynamic CSS
  • Handle drop-downs
  • How to work with file upload
  • Handle Alerts & Popups
  • Handle Multiple Windows
  • Mouse Hover event in Selenium
  • Right Click
  • Double Click
  • Drag and Drop
  • Capture Screenshots in Selenium
  • Parameterization
  • Synchronization
  • Implicit Wait, Explicit Wait and Fluent Wait in Selenium
  • Implicit Waits
  • Explicit WebDriver Waits
  • Fluent Wait In Selenium
  • Apache POI
  • How To Read Data From Excel File
  • How To Write Data In Excel File
  • Database Testing Using MSSQL
  • Database Testing Using MySQL
  • Database Testing Using DB2
  • Handle Ajax Call in Selenium
  • Listeners in Selenium
  • Handling JavaScript in Selenium
  • Stale Element Reference Exception in Selenium
  • Integrate Sikuli with Selenium
  • Headless Browser Testing 
  • Headless Browser Testing using HtmlUnitDriver
  • Headless Browser Testing using PhanthomJSDriver

  • TESTNG:

  • TestNG Installation
  • TestNG Complete Tutorial

  • REPORTS:

  • Extent Reports Introduction
  • Extent Reports Generation
  • Capturing Screenshots & Including In Extent Reports
  • Extent Reports Version 4

  • BUILD & CONTINUOUS INTEGRATION TOOLS:

  • ANT Build Tool - How To Download & Install
  • Maven Build Tool - How To Download & Install
  • Creating Maven Selenium Project
  • GIT Integration with Selenium
  • Jenkins - How To Download & Install
  • Jenkins - Executing TestNG Scripts
  • Jenkins - Generating Reports After Test Execution
  • Jenkins - Executing Maven Project
  • Create build and Execute build for nightly execution
  • Send Email report based on build Status
  • Selenium Continuous Integration with Jenkins [Selenium – Maven – Git – Jenkins] – Step By Step Guide

  • CROSS BROWSER TESTING:

  • Running Selenium Tests On BrowserStack
  • Kobiton - Mobile Testing Platform with Real Devices

  • MOBILE TESTING:

  • Mobile Testing Platform with Real Devices

  • AUTOMATION FRAMEWORKS:

  • What is Framework & Types of Framework
  • Page Object Model Design Pattern
  • Data Driven Framework
  • How to explain Test Automation Framework or Selenium Automation Framework Architecture In Interview

  • API Testing:

  • Learn API Testing
  • Postman Tutorial (API Testing with Postman)

  • INTERVIEW QUESTIONS:

  • Test Automation Framework Interview Questions
  • Selenium Interview Questions
  • TestNG Interview Questions
  • Java Interview Questions
  • Python Interview Questions
  • API Testing Interview Questions

  • SAMPLE RESUME:

  • Automation Tester Resume
  • How To Execute TestNG Tests Using Jenkins | Software Testing Material

    In the earlier post, we have seen How To Run TestNG Scripts (testng.xml) Using Command Prompt and Using Batch file (.bat). In this post, we see how to execute TestNG Tests Using Jenkins. To do this, we need to have the following

    i. TestNG Project
    ii. Jenkins – Check this post on Installation of Jenkins.

    Don’t Miss: Selenium Complete Tutorial

    How To Execute TestNG Tests Using Jenkins

    Let’s get started on How To Create TestNG Project.

    Step 1: Creating TestNG Project. Follow this link to create TestNG Project.

    Must Read: TestNG Complete Tutorial

    Step 2: Installing Jenkins. Follow this link for Installing Jenkins

    We have TestNG Project and Jenkins ready. Now, lets execute TestNG Tests Using Jenkins.

    In the below image, you could see the project structure and testng.xml

    Open Jenkins. By default it will be ‘localhost/8080’

    Click on ‘New Item’

    Enter an Item Name of your preference. I gave the name as ‘TestNGProject‘. In the screenshot below, you could see the name as MavenProject (ignore it).

    Select ‘Freestyle Project’ and click on OK button

    Now, click on item ‘TestNGProject’

    Under General Tab, you could see ‘TestNGProject‘. Click on ‘Advanced‘ button to add the custom workspace.

    Now select the ‘Use Custom Workspace‘ checkbox and enter the path of your workspace. My workspace is available at this location ‘D:\DeleteNow\TestNGProject

    Scroll down to ‘Build‘ option. Click on ‘Add Build Step‘ and choose the value ‘Execute Windows batch command‘ from the drop down list.

    My batch file name is ‘BatchRun.bat’ and I specified the same here.

    Click on ‘Apply‘ and ‘Save

    We have created a new project ‘TestNGProject‘ with the configuration to run TestNG Tests using Jenkins. You could see in the below screenshot.

    Let’s execute it now. Click on ‘Build Now‘ button. It will invoke testng.xml from the batch file.

    Right click on Build Number (here in my case it is #1) and click on Console Output to see the result.

    You could see the print statement ‘softwaretestingmaterial.com’ and Build Status ‘Success’

    This way, we could execute TestNG Tests using Jenkins. In the next post, we see how to generate TestNG Reports after the completion of execution. Same way, we could execute Maven Project Using Jenkins.

    Run TestNG Tests Using Jenkins

    Get our latest blog posts delivered to your inbox

    Subscribe and get popular blog posts about software testing industry.

    Rajkumar

    24 thoughts on “How To Execute TestNG Tests Using Jenkins | Software Testing Material”

    1. Hi Rajkumar,
      Thanks for the post. But you didn’t mention how to create “BatchRun.bat” file

    2. Hello sir,
      I just want to know that, I am facing an issue after creating batch file. so my question is that, for creating batch file to run testNG is it neccessary to ad mozilla driver?

      • Hi Roney, in this post you could find how to create batch file.

        FYKI: In the batch file, we don’t pass any driver info.

        • no sir. i am not passing any driver info in batch file. but in my script i am passing driver info for chrome. so its not excute the script. thats why i am asking you that is it necessary to pass only gecko driver?

        • My batch file is not running properly and not showing any GUI

          • If you are using chrome,
            System.setProperty("webdriver.chrome.driver",path of executable file "Chromedriver.exe")
            Here is the link

            • yes with the help of this driver i can run my script in eclipse properly.. But its not work after executing batch file.

            • ok i have done it. i think batch file is only supported to firefox browser..

            • Fine Roney. It supports chrome too.

    3. Many Thanks for your fantastic Guides in all issues

      • Thanks for your kind words Akado

      • Hi whats the value you are passing in your xml file. Share your xml file

        • Thank you for responding!

          This is my xml file:

          • Post without < and > replace it with ?

    4. ?xml version=”1.0″ encoding=”UTF-8″?

    5. ?xml version=”1.0″ encoding=”UTF-8″?
      !DOCTYPE suite SYSTEM “http://testng.org/testng-1.0.dtd”
      suite name=”Suite”

      test name=”FirefoxTest”
      parameter name=”browser” value=”Firefox”>

      /suite

    6. ?xml version=”1.0″ encoding=”UTF-8″?
      !DOCTYPE suite SYSTEM “http://testng.org/testng-1.0.dtd”
      suite name=”Suite”

      test name=”FirefoxTest”
      parameter name=”browser” value=”Firefox” parameter
      classes
      class name=”scripts.testJenkins”
      classes
      test

      suite

    7. I managed to post the XML here!

      • Hi Sandeep,
        I have posted answer here

    8. Hi,

      I am unable to run batch i am facing total test run:0 skip:0 issue while trying to run the testng.xml file in CMD.

    Leave a Comment

    Share via
    Copy link
    Powered by Social Snap