Close

CAPABILITY GENERATOR

LambdaTestAutomation Testing ● Getting Started With Selenium Automation Testing using LambdaTest

Getting Started With Selenium Automation Testing using LambdaTest


LambdaTest Selenium Automation Grid enables you to perform end-to-end automation tests on a secure, reliable, and scalable Selenium infrastructure. You can perform automated cross browser testing with Selenium scripts on 2000+ browsers and operating systems environments, giving you higher test coverage and at significantly less built times. LambdaTest will help you evaluate how well your web application renders when accessed through a variety of different browsers. You can perform automated cross-browser testing of your locally hosted web pages using LambdaTest Tunnel. You could also run a single test across multiple browser/OS configurations simultaneously. This post will help you to quickly get started with running your automation test scripts on LambdaTest Selenium automation grid.

To see the complete list of Supported Languages and Frameworks, please refer here.
We are preparing documentation for more frameworks. If you want us to prioritize documentation of your beloved framework then feel free to give us a shout.

Selenium Version Requirement


LambdaTest recommends you to always use the latest version of the Selenium WebDriver for your particular scripting language.

Default Selenium Version


LambdaTest Capabilities Generator will by default make use of latest compatible Selenium version based on the selections of browser/OS configurations. However, you are also allowed to test across other Selenium versions, in case if you want to run your automation script through a specific, legacy Selenium version. Below is the representation of the default Selenium versions used depending upon your browser selection.

Browser Name
Default Selenium Version
Microsoft Edge
2.52.0
Chrome
Latest Chromedriver
Firefox
Dev: 3.4.0

Beta: 3.4.0

53+: 3.4.0

39+: 2.53.1
Safari
11.0: 3.4.0

< 11.0: 2.48.0
Internet Explorer
2.53.1

Note:‘selenium_version’ is the desire capability responsible for selecting a Selenium version at LambdaTest. For instance,

Product Access


To run your Selenium tests on the LambdaTest requires a username and an access key. You can always get your username and access key from the Desired Capabilities Generator, as shown in the below image:

Starting With Automation Testing On LambdaTest


When you start with automation testing for the first time, we understand it might not be that easy to run your project in the first go (it might be due to an environment problem, project setup, or something else). But don’t worry! We got you covered.

We will help you get started with automation testing on LambdaTest in a flash speed. This document will provide a step by step guide to get started and run your first automation test. Let’s get you started.

When you open the Automation dashboard for the first time, you can see the two options to get started with automation testing on LambdaTest:

  • Get started by running automation tests on your local machine
  • Run your automation on Gitpod

Let’s see both of these features one by one.

Getting Started By Running Your Automation Tests On Gitpod


If you want to run the automation tests on cloud-based workspace Gitpod, instead of your local machine, with the help of LambdaTest’s cloud-based online Selenium grid, you can choose the option Run in Gitpod.

You can choose among the available list of languages and frameworks available, to view the test script and execute it on Gitpod.

Currently, we provide demos for the following languages and frameworks, but we support all. You can view the complete list from here.

Let’s see each of the above frameworks one by one.

Running Automation Tests Using Python PyUnit Framework On Gitpod


When you choose PyTest framework under Python language in the dialog box that appears, you will be redirected to the cloud based online workspace on Gitpod.

Once you log in, you can see the sample PyTest repo being loaded in the Gitpod workspace.

In this Gitpod workspace, your username and the access key will be automatically embedded. But you can always get your username and access key from the Desired Capabilities Generator, as shown in the below image:

By default, this repo runs the test on the below desired capabilities:

To run the tests on a different environment than above, you can use the Desired Capabilities Generator to select the desired capabilities and copy paste the code in the single_test.py file, on line 13-18.

The test scenario in this repo includes:

  • Open the LambdaTest Sample ToDo app
  • Check the first item in the list
  • Check the second item in the list
  • Add a new item to the list with custom text

Below is the complete code for the above test script:

To run the Single Test using Python PyTest framework, just copy the below code and paste it in the console of the Gitpod workspace:

As soon as you press Enter, the test execution will start. You can switch back to the automation dashboard to see the test being queued and running, after you reload the page. The tests will be executed, and you can see the status of the tests.

To know more about how to access and manage your automation dashboard, you can refer to this document.

To run the Parallel Test using the Python PyTest framework, just copy the below code and paste it in the console of the Gitpod workspace:

To know more about running tests in PyTest framework on LambdaTest, please refer here.

To know more about running tests in other Python frameworks on LambdaTest, please refer here.

Running Automation Tests Using Python Robot Framework On Gitpod


When you choose Robot framework under Python language in the dialog box that appears, you will be redirected to the cloud based online workspace on Gitpod.

Once you log in, you can see the sample Robot repo being loaded in the Gitpod workspace.

In this Gitpod workspace, your username and the access key will be automatically embedded. But you can always get your username and access key from the Desired Capabilities Generator, as shown in the below image:

By default, this repo runs the test on the user-specified desired capabilities, passed using the code:

The test scenario in this repo includes:

  • Open the LambdaTest Sample ToDo app
  • Check the first item in the list
  • Check the second item in the list
  • Add a new item to the list with custom text

Below is the complete code for the above test script:

To run the Single Test using Python Robot framework, just copy the below code and paste it in the console of the Gitpod workspace. This code passes the desired capabilities as Windows 10, Chrome and 68 for the capabilities platform, browser name and browser version respectively.

As soon as you press Enter, the test execution will start. You can switch back to the automation dashboard to see the test being queued and running, after you reload the page. The tests will be executed, and you can see the status of the tests.

To know more about how to access and manage your automation dashboard, you can refer to this document.

To run the Parallel Test using the Python PyTest framework, just copy the below code and paste it in the console of the Gitpod workspace:

To know more about running tests in Robot framework on LambdaTest, please refer here.

To know more about running tests in other Python frameworks on LambdaTest, please refer here.

Running Automation Tests Using Java JUnit Framework On Gitpod


When you choose JUnit framework under Java language in the dialog box that appears, you will be redirected to the cloud based online workspace on Gitpod.

Once you log in, you can see the sample JUnit repo being loaded in the Gitpod workspace.

In this Gitpod workspace, your username and the access key will be automatically embedded. But you can always get your username and access key from the Desired Capabilities Generator, as shown in the below image:

By default, this repo runs the test on the below desired capabilities:

To run the tests on a different environment than above, you can use the Desired Capabilities Generator to select the desired capabilities and copy paste the code in the SingleTest.java file, on line 33-43.

The test scenario in this repo includes:

  • Open the LambdaTest Sample ToDo app
  • Check the first item in the list
  • Check the second item in the list
  • Add a new item to the list with custom text

Below is the complete code for the above test script:

To run the Single Test using Java JUnit framework, just copy the below code and paste it in the console of the Gitpod workspace:

As soon as you press Enter, the test execution will start. You can switch back to the automation dashboard to see the test being queued and running, after you reload the page. The tests will be executed and you can see the status of the tests.

To know more about how to access and manage your automation dashboard, you can refer to this document.

To know more about running tests in JUnit framework on LambdaTest, please refer here.

To know more about running tests in other Java frameworks on LambdaTest, please refer here.

Running Automation Tests Using Java TestNG Framework On Gitpod


When you choose TestNG framework under Java language in the dialog box that appears, you will be redirected to the cloud based online workspace on Gitpod.

Once you log in, you can see the sample TestNG repo being loaded in the Gitpod workspace.

In this Gitpod workspace, your username and the access key will be automatically embedded. But you can always get your username and access key from the Desired Capabilities Generator, as shown in the below image:

By default, this repo runs the test on the below desired capabilities:

To run the tests on a different environment than above, you can use the Desired Capabilities Generator to select the desired capabilities and copy paste the code in the SingleTest.java file, on line 30-39.

The test scenario in this repo includes:

  • Open the LambdaTest Sample ToDo app
  • Check the first item in the list
  • Check the second item in the list
  • Add a new item to the list with custom text

Below is the complete code for the above test script:

To run the Single Test using Java TestNG framework, just copy the below code and paste it in the console of the Gitpod workspace:

As soon as you press Enter, the test execution will start. You can switch back to the automation dashboard to see the test being queued and running, after you reload the page. The tests will be executed and you can see the status of the tests.

To know more about how to access and manage your automation dashboard, you can refer to this document.

To run the Parallel Test using the Java TestNG framework, just copy the below code and paste it in the console of the Gitpod workspace:

To know more about running tests in TestNG framework on LambdaTest, please refer here.

To know more about running tests in other Java frameworks on LambdaTest, please refer here.

Running Automation Tests Using Java Cucumber Framework On Gitpod


When you choose Cucumber framework under Java language in the dialog box that appears, you will be redirected to the cloud based online workspace on Gitpod.

Once you log in, you can see the sample Cucumber repo being loaded in the Gitpod workspace.

In this Gitpod workspace, your username and the access key will be automatically embedded. But you can always get your username and access key from the Desired Capabilities Generator, as shown in the below image:

By default, this repo runs the test on the below desired capabilities:

To run the tests on a different environment than above, you can use the Desired Capabilities Generator to select the desired capabilities and copy paste the code in the ToDoStepDefinition.java file, on line 34-44.

The test scenario in this repo includes:

  • Open the LambdaTest Sample ToDo app
  • Check the first item in the list
  • Check the second item in the list
  • Add a new item to the list with custom text

Below is the complete code for the above test script:

To run the Single Test using Java Cucumber framework, just copy the below code and paste it in the console of the Gitpod workspace:

As soon as you press Enter, the test execution will start. You can switch back to the automation dashboard to see the test being queued and running, after you reload the page. The tests will be executed and you can see the status of the tests.

To know more about how to access and manage your automation dashboard, you can refer to this document.

To know more about running tests in Cucumber framework on LambdaTest, please refer here.

To know more about running tests in other Java frameworks on LambdaTest, please refer here.

Running Automation Tests Using Javascript NightwatchJS Framework On Gitpod


When you choose NightwatchJS framework under Javascript language in the dialog box that appears, you will be redirected to the cloud based online workspace on Gitpod.

Once you log in, you can see the sample NightwatchJS repo being loaded in the Gitpod workspace.

In this Gitpod workspace, your username and the access key will be automatically embedded. But you can always get your username and access key from the Desired Capabilities Generator, as shown in the below image:

The test scenario in this repo includes:

  • Go to www.google.com
  • Type “LambdaTest” in the google search box
  • Compare the title of the first search result with “LambdaTest – Google Search”
  • Assert the title value

Below is the complete code for the above test script:

To run the Single Test using Javascript NightwatchJS framework, just copy the below code and paste it in the console of the Gitpod workspace:

As soon as you press Enter, the test execution will start. You can switch back to the automation dashboard to see the test being queued and running, after you reload the page. The tests will be executed and you can see the status of the tests.

To know more about how to access and manage your automation dashboard, you can refer to this document.

To know more about running tests in NightwatchJS framework on LambdaTest, please refer here.

To know more about running tests in other Javascript frameworks on LambdaTest, please refer here.

Running Automation Tests Using Javascript WebDriverIO Framework On Gitpod


When you choose WebDriverIO framework under Javascript language in the dialog box that appears, you will be redirected to the cloud based online workspace on Gitpod.

Once you log in, you can see the sample WebDriverIO repo being loaded in the Gitpod workspace.

In this Gitpod workspace, your username and the access key will be automatically embedded. But you can always get your username and access key from the Desired Capabilities Generator, as shown in the below image:

The test scenario in this repo includes:

  • Go to www.google.com
  • Type “test123” in the google search box
  • Compare the title of the first search result with “LambdaTest – Google Search”
  • Assert the title value

Below is the complete code for the above test script:

To run the Single Test using Javascript WebDriverIO framework, just copy the below code and paste it in the console of the Gitpod workspace:

As soon as you press Enter, the test execution will start. You can switch back to the automation dashboard to see the test being queued and running, after you reload the page. The tests will be executed and you can see the status of the tests.

To know more about how to access and manage your automation dashboard, you can refer to this document.

To run the Parallel Test using the Javascript WebDriverIO framework, just copy the below code and paste it in the console of the Gitpod workspace:

To know more about running tests in WebDriverIO framework on LambdaTest, please refer here.

To know more about running tests in other Javascript frameworks on LambdaTest, please refer here.

Running Automation Tests Using Javascript TestCafe Framework On Gitpod


When you choose TestCafe framework under Javascript language in the dialog box that appears, you will be redirected to the cloud based online workspace on Gitpod.

Once you log in, you can see the sample TestCafe repo being loaded in the Gitpod workspace.

In this Gitpod workspace, your username and the access key will be automatically embedded. But you can always get your username and access key from the Desired Capabilities Generator, as shown in the below image:

By default, this repo runs the test on the default desired capabilities. To run the tests on a different environment than above, you can use the Desired Capabilities Generator to select the desired capabilities.

To run the Single Test using Javascript TestCafe framework, just copy the below code and paste it in the console of the Gitpod workspace:

As soon as you press Enter, the test execution will start. You can switch back to the automation dashboard to see the test being queued and running, after you reload the page. The tests will be executed, and you can see the status of the tests.

To know more about how to access and manage your automation dashboard, you can refer to this document.

To run the Parallel Test using the Javascript TestCafe framework, just copy the below code and paste it in the console of the Gitpod workspace:

To know more about running tests in TestCafe framework on LambdaTest, please refer here.

To know more about running tests in other Javascript frameworks on LambdaTest, please refer here.

Get Started By Running Automation Tests On Local Machine


If you want to run the automation tests on your local machine, with the help of LambdaTest’s cloud-based online Selenium grid, you can choose the option Get Started.

Once you do, you can see the option to run tests on various languages like:

You can select the language of your choice to get started. For demo purpose, we will show you how to get started with each language.

1. Java


If you choose Java as your preferred language to get started, you will see a window like below, where you can configure your test script and environment based on your choice.

So to run your Java test on local machine:

  • Verify your test script: To help you get started, we have already covered a test scenario which:
    – Open the LambdaTest Sample ToDo app
    – Check the first item in the list
    – Check the second item in the list
    – Add a new item to the list with custom text

  • Select OS: Next you need to generate the desired capabilties. Select the desired operating system from the given list, on which you want to run your tests.

  • Select Resolution: Select the desired resolution from the given list, on which you want to run your tests.
  • Select Browser: Select the desired browser from the given list, on which you want to run your tests.
  • Select Browser Version: Select the desired version of the browser from the given list, on which you want to run your tests.
  • Save the code: Once the desired capabilities are set, copy the code from the editor and save them in your local Java project. Below is the complete code of the selected desired capabilities, as shown in the image.

  • You need to press the Run your test at the bottom to go on to the next step.
  • Select the Local OS: Now the next step is to select the local machine OS on which you are expecting the tests to run.
  • Copy the pom.xml code: Copy the code of the pom.xml file and paste it in your local project.
  • Install the necessary plugins and packages: You would also need latest Selenium client and it’s WebDriver Bindings. Selenium can be downloaded from here. You should always run latest version of Selenium Client and WebDriver on LambdaTest Selenium cloud grid to avoid any errors.
  • Run your test locally: Now go to the directory where the file is saved and open the command terminal. It will be showing something like this:

    Then you need to run the test from maven via surefire plugin, using the below command:

That’s all. This will run your tests and you can see the output in your console.

Note: If you decide at anytime that you don’t want to run your test locally, or want to try out the cloud-based workspace to execute the test, just click on the “Run in Gitpod” option available on your screen.

2. Node JS


Similarly, if you choose Node JS as your preferred language to get started, the steps will remain the same as above Java language, except the internal code and syntax details. You will see a window like below to configure your test script and environment based on your choice.

So to run your Node JS test on the local machine:

  • Verify your test script: To help you get started, we have already covered a test scenario which:
    – Go to www.google.com
    – Type “LambdaTest” in the google search box
    – Compare the title of the first search result with “LambdaTest – Google Search”
    – Assert the title value

  • Select OS: Next you need to generate the desired capabilties. Select the desired operating system from the given list, on which you want to run your tests.

  • Select Resolution: Select the desired resolution from the given list, on which you want to run your tests.
  • Select Browser: Select the desired browser from the given list, on which you want to run your tests.
  • Select Browser Version: Select the desired version of the browser from the given list, on which you want to run your tests.
  • Save the code: Once the desired capabilities are set, copy the code from the editor and save them in your local Node JS project. Below is the complete code of the selected desired capabilities, as shown in the image.

  • You need to press the Run your test at the bottom to go on to the next step.
  • Select the Local OS: Now the next step is to select the local machine OS on which you are expecting the tests to run.
  • Install the necessary plugins and packages: Now go to the directory where the file is saved and open the command terminal. It will be showing something like this:

    You would also need the latest Selenium client and its WebDriver Bindings. Selenium can be downloaded using the code given below. You should always run the latest version of Selenium Client and WebDriver on LambdaTest Selenium cloud grid to avoid any errors.

  • Run your test locally: Then you need to run the test file, using the below command:

That’s all. This will run your tests and you can see the output in your console.

Note: If you decide at anytime that you don’t want to run your test locally, or want to try out the cloud-based workspace to execute the test, just click on the “Run in Gitpod” option available on your screen.

3. Python


Similarly, if you choose Python as your preferred language to get started, the steps will remain the same as above Java language, except the internal code and syntax details. You will see a window like below to configure your test script and environment based on your choice.

So to run your Python test on the local machine:

  • Verify your test script: To help you get started, we have already covered a test scenario which:
    – Open the LambdaTest Sample ToDo app
    – Check the first item in the list
    – Check the second item in the list
    – Add a new item to the list with custom text

  • Select OS: Next you need to generate the desired capabilties. Select the desired operating system from the given list, on which you want to run your tests.

  • Select Resolution: Select the desired resolution from the given list, on which you want to run your tests.
  • Select Browser: Select the desired browser from the given list, on which you want to run your tests.
  • Select Browser Version: Select the desired version of the browser from the given list, on which you want to run your tests.
  • Save the code: Once the desired capabilities are set, copy the code from the editor and save them in your local Python project. Below is the complete code of the selected desired capabilities, as shown in the image.

  • You need to press the Run your test at the bottom to go on to the next step.
  • Select the Local OS: Now the next step is to select the local machine OS on which you are expecting the tests to run.
  • Install the necessary plugins and packages: Now go to the directory where the file is saved and open the command terminal. It will be showing something like this:

    You would also need the latest Selenium client and its WebDriver Bindings. Selenium can be downloaded using the code given below. You should always run the latest version of Selenium Client and WebDriver on LambdaTest Selenium cloud grid to avoid any errors.

  • Run your test locally: Then you need to run the test file, using the below command:

That’s all. This will run your tests and you can see the output in your console.

Note: If you decide at anytime that you don’t want to run your test locally, or want to try out the cloud-based workspace to execute the test, just click on the “Run in Gitpod” option available on your screen.

4. Ruby


Similarly, if you choose Ruby as your preferred language to get started, the steps will remain the same as above Java language, except the internal code and syntax details. You will see a window like below to configure your test script and environment based on your choice.

So to run your Ruby test on the local machine:

  • Verify your test script: To help you get started, we have already covered a test scenario which:
    – Open the LambdaTest Sample ToDo app
    – Check the first item in the list
    – Check the second item in the list
    – Add a new item to the list with custom text

  • Select OS: Next you need to generate the desired capabilties. Select the desired operating system from the given list, on which you want to run your tests.

  • Select Resolution: Select the desired resolution from the given list, on which you want to run your tests.
  • Select Browser: Select the desired browser from the given list, on which you want to run your tests.
  • Select Browser Version: Select the desired version of the browser from the given list, on which you want to run your tests.
  • Save the code: Once the desired capabilities are set, copy the code from the editor and save them in your local Ruby project. Below is the complete code of the selected desired capabilities, as shown in the image.

  • You need to press the Run your test at the bottom to go on to the next step.
  • Select the Local OS: Now the next step is to select the local machine OS on which you are expecting the tests to run.
  • Install the necessary plugins and packages: Now go to the directory where the file is saved and open the command terminal. It will be showing something like this:

    You would also need the latest Selenium client and its WebDriver Bindings. Selenium can be downloaded using the code given below. You should always run the latest version of Selenium Client and WebDriver on LambdaTest Selenium cloud grid to avoid any errors.

  • Run your test locally: Then you need to run the test file, using the below command:

That’s all. This will run your tests, and you can see the output in your console.

LambdaTest Automation Testing with Continuous Integration Platforms


LambdaTest supports the following Continuous Integration tools:

LambdaTest Integration With Project Management Platform


LambdaTest integrates with the project management applications. With the help of these integrations you can directly send the tracked bug in LambdaTest in a single-click to these applications.

List of project management tools which can be integrated with the LambdaTest.

If your tool is not in the list, let LambdaTest Support team know about it.