Getting Started With Integrating Jenkins and Sauce Labs

Jenkins is an open source automation server that helps to automate the non-manual part of the software development process, with continuous integration and facilitating technical aspects of continuous delivery.

Sauce Labs is one of the largest continuous testing clouds of web and mobile applications that access web browsers, mobile emulators and simulators, and real mobile devices.

Why integrate Jenkins with Sauce Labs?
  • Environment details can be provided by Jenkins. It is not required to pass details or update in Test Scripts.
  • The report can be published on Jenkins Environment, where you can view SauceLabs execution log and videos can be download from Jenkins Environment.
  • Jenkins build number can be mapped with Sauce Labs test execution and we will get build number in Sauce Labs and can easily identify execution.
  • For parallel execution, we parameterize all os and browsers combination from Jenkins environment.
Install Sauce Lab plugin in Jenkins CI tool
  1. Go to “Manage” Jenkins
  2. Click on “Manage” Plugin
  3. Search “Sauce OnDemand Plugin” and install
  4. Below plugins will be installed, other plugins which are listed are dependent plugins
Configuring Project to Use Sauce Connect 
  1. Created Jenkins Project
  2. Go to Build environment and select “Sauce Labs Support”
  3. You will get Sauce Lab Options and Sauce Connect Advance Option
  4. Add Credential of your Sauce Lab account by providing username and API key

  1. Select added credentials
  2. Select web driver browses details like below details:

  1. Integrated your automation suite with Build section.
Setting Desired Capabilities for Jenkins Projects in Automation code

The Sauce plugin for Jenkins provides an easy way for you to populate the desired capabilities for the operating system and browser combinations for your tests as environment variables. It doesn’t require the need to hardcode them into your tests.

After setting up Desire capabilities in Jenkins Sauce Labs we need to integrate below desire capabilities in code:

desiredCapabilities.setBrowserName(System.getenv(“SELENIUM_BROWSER”)); desiredCapabilities.setVersion (System.getenv (“SELENIUM_VERSION”)); desiredCapabilities.setCapability(CapabilityType.PLATFORM, System.getenv(“SELENIUM_PLATFORM”));

You may also like: How to Install and Execute Java and then Configure Maven on Windows Machine?

Leave a comment

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