CAPABILITY GENERATOR

LambdaTest DocumentationAutomation Testing ● Jenkins Integration With LambdaTest

Jenkins Integration With LambdaTest


Jenkins is a widely popular Continuous Integration (CI) tool. It is a free to use, open source software, written in Java. Jenkins helps to boost your release agility by providing Continuous Integration services. You can trigger these services by a web application server or simply using command line as well to hasten deployment pipeline & release migration activities. Jenkins’s popularity offer thousands of plugins to fast track your productivity. One such plugin to help you pace up automated cross browser testing is LambdaTest Jenkins plugin. With LambdaTest Jenkins plugin you will be able to easily automate your Selenium test scripts by connecting your Jenkins CI instance to LambdaTest Selenium grid. LambdaTest Selenium grid will offer you a wide library of 2000+ browsers and browser versions so you could achieve a higher test coverage while performing automation testing using the Selenium test suite.

LambdaTest Jenkins plugin will help you to:

  • Configure your LambdaTest credentials for your Jenkins jobs.
  • Set up and tear down the Lambda Tunnel binary file to perform automated cross browser testing even on your locally hosted web apps
  • Embed all the test results such as video logs, network logs, and screenshots of every step performed through LambdaTest with your Jenkins job results.

Prerequisites


  • A LambdaTest account
  • An existing Jenkins CI server (version 2.138.2+)

Installing the Jenkins Plugin


Download LambdaTest Jenkins plugin to run your Selenium tests with Jenkins on LambdaTest. You need to be granted with the administrator level access before proceeding with Jenkins installation.

Make sure to have no active build jobs in execution or queue before heading forward with the LambdaTest Jenkins plugin installation.

  1. Click Manage Jenkins then Manage Plugins.
  2. Click the Available tab.
  3. In the Filter box type LambdaTest.
  4. You will encounter a list of plugins where you need to select LambdaTest.
  5. To install LambdaTest Jenkins plugin, you would have to select the checkbox in front of LambdaTest. After the installation of plugin completes successfully, you will be able to find the LambdaTest Jenkins plugin under your installed plugins


Sometimes your recently installed plugins fail to synchronize with your available plugins on Jenkins. In case if you don’t find LambdaTest plugin under your available plugins, then you could force Jenkins to refresh the list by simply clicking the Check Now button to fetch latest plugins from the Jenkins update center.

How To Configure Your LambdaTest Credentials?


After installing the LambdaTest Jenkins plugin for performing automated cross browser testing using LambdaTest Selenium grid. You would need to configure the LambdaTest credentials in your Jenkins CI server for integrating your Selenium WebDriver tests with Jenkins. You would need to work with Jenkins UI for proceeding with configuration.

To Configure LambdaTest Credentials Using Jenkins UI


Follow these steps to configure LambdaTest with Jenkins:

  1. On the Home page of Jenkins click Credentials.
  2. Under Credentials click System. System page displays.
  3. In the System, click Global credentials (Unrestricted) domain. Global credentials page opens.
  4. Click Add Credentials. Add Credentials page opens.
  5. Enter the relevant data in the fields and click Verify Credentials. After verification click the OK button.
    Jenkins generate the ID which is visible in the Credential page.
  6. Save your changes.


After your credentials are successfully added then an ID would be generated by Jenkins. To retrieve this ID for LambdaTest Credentials you would have to go to Jenkins home page and click on Credentials from the left navigation menu.

From the Jenkins home page, click Credentials from the left menu. You can copy the ID for LambdaTest credentials.

Configuring The Build Environment Through Jenkins UI


To enable Lambda Tunnel for performing tests on your locally hosted web application or website, perform the following:

Visit the tab for Build Environment and mark the tick on the box left to LAMBDATEST..

That is all you need for performing automated cross browser testing on your locally hosted web pages or web files using the LambdaTest Jenkins plugin with Lambda Tunnel. In the next section you will learn how to enable the Lambda Tunnel.

Configure LambdaTest Tunnel


Here we will have a look at the process of enabling Lambda Tunnel for testing your locally hosted web apps.

Visit the tab for Build Environment and mark the tick on the box left to LAMBDATEST.

  1. We would recommend to keep the LambdaTest Local Path empty, that way, the plugin will download the LT binary file automatically. However, if you wish to use a binary by downloading externally then you need to provide the location of the file as the LambdaTest Local Path. But if your Jenkins works on master-slave configuration set up, then it would be best to leave the path empty for allowing the plugin to download the relevant binary file with respect to the operating system of your local machine.
  2. You can configure additional settings with Lambda Tunnel by using the option to Use Local Tunnel.

Enviroment Variable For LambdaTest Jenkins Plugin

Environment Variables
Description
$LT_OPERATING_SYSTEM
OS you wish to test your website with.
$LT_BROWSER_NAME
Name of the browser on which you wish to test.
$LT_BROWSER_VERSION
Particular browser version on which you wish to test.
$LT_RESOLUTION
Specify the screen resolution.
$LT_GRID_URL
Your LambdaTest hub URL
$LT_BUILD_NAME
Represents a particular build name.
$LT_BUILD_NUMBER
Represents a particular build number.
$LT_BROWSERS
An array of combinations.
$USERNAME
Your LambdaTest username.
$LT_TUNNEL_NAME
Name of your Lambda Tunnel for local testing.
$TEMP
Temporary variable.

Using the above variables you will recieve an output in the below format.

Running Your First Test


To run your first test using Jenkins LambdaTest plugin, you would need to set a test build. You can perform that easily through Jenkins UI by clicking on Build Now.

As you click on Build Now, you will find a new build generating under the build history.

If you click on the build you will find the logs for console output. You would also notice a LambdaTest icon on the left which will provide you in-depth details regarding your Selenium test through an i-frame.

As you click on the LT icon, your details for the Selenium test will be loaded with respect to LambdaTest platform usage. This will include details of the test session, including the video log as well.

Kudos! You successfully executed your Selenium test suite using Jenkins with LambdaTest plugin.