LambdaTestAutomation Testing ● Robot Selenium: Run Automation Scripts on Selenium Grid using Robot Testing Framework

Robot Selenium: Run Automation Scripts on Selenium Grid using Robot Testing Framework

LambdaTest Selenium Automation Grid is a cloud based scalable Selenium testing platform which enables you to run your automation scripts on 2000+ different browsers and operating systems. You can now run your Python Selenium automated test cases on a scalable Selenium infrastructure that is running real browsers and real operating systems. This post will help you in getting started with configuring and running your Python based automation test scripts on LambdaTest Selenium cloud platform. In this post we would be exploring:

  1. How to run a sample Selenium with Robot testing framework on LambdaTest Automation.
  2. How to set up an environment for Robot Selenium testing your locally hosted websites or web pages.
  3. How to configure Robot testing framework desired capabilities for executing a Selenium test.
  4. How to run your test cases in parallel to reduce build times
  5. Advanced features of LambdaTest.

Prerequisites For Running Robot Selenium Tests

All the code samples in this documentation can be found in the Robot LambdaTest Repository on GitHub. You can either download or clone the repository to quickly run your tests.

  1. Global Dependencies
    • Have Selenium WebDriver client driver installed inside your local Python environment.
    • Make sure that you have the latest Python build installed. You can download the latest Python build from
    • You would need Python package manager, pip, as well. Usually latest python installers come prepacked with pip. However if you don’t have pip, you can install it using command:
    • Install Python with Homebrew
    • Download the driver from the link, or you can use pip to install it.
    • Make sure you have Robot testing framework installed in your system. In case you don’t! Enter the below command:
    • If you wish to test locally hosted or privately hosted projects, you would also need LambdaTest Tunnel binary file.
  2. LambdaTest Authentication Credentials
    • You would need to your LambdaTest authentication credentials(Access key & Username). You need to update these credentials in the /Resources/Common.robot file.

  3. Project Dependencies
    • Install necessary packages (use sudo if necessary)

Getting Started With Robot Selenium & LambdaTest

The first step in using LambdaTest platform is to understand LambdaTest’s Selenium Grid capabilities. Our Selenium Grid uses remote webdriver instead of normal Selenium client browser drivers so if you are migrating from locally run Selenium, you would have to invoke LambdaTest Selenium remote webdriver. Next you need to specify in your code, which browser, browser versions, operating systems, and resolution you wish to run your test on, along with defining LambdaTest specific capabilities. You can checkout LambdaTest Capabilities Generator tool to understand more about how you can define running browser environments and leverage advanced LambdaTest capabilities.

Let’ start with a simple Selenium Remote Webdriver test first. The Robot Selenium script below tests a simple to-do application with basic functionalities like mark items as done, add items in list, calculate total pending items etc. You can also find this at our GitHub repository.

Feature: Test to add item Scenario: Test sample-todo-app Given I go to sample-todo-app to add item Then I Click on first checkbox and second checkbox When I enter item to add When I click add button Then I should verify the added item

Now, we have to create step definition file.

Here is common.robot file to setup mandatory details to run at LambdaTest.

Execute The Test Using Robot Testing Framework

You would need to execute the below command in your terminal/cmd.

Testing Locally Hosted Web Projects Using Robot Selenium

To help you perform cross browser testing of your locally stored web pages, LambdaTest provides an SSH(Secure Shell) tunnel connection with the name LambdaTest Tunnel. With LambdaTest Tunnel, you can test your locally hosted files before you make them live over the internet. You could even perform cross browser testing from different IP addresses belonging to various geographic locations. You can also use LambdaTest Tunnel to test web-apps and websites that are permissible inside your corporate firewall. The SSH tunnel provided by LambdaTest acts as a proxy server for hosting your web pages from your local machine to Virtual machines running on LambdaTest cloud servers. Curious to know more about LambdaTest Tunnel?

Follow our documentation on LambdaTest Tunnel to know it all. OS specific instructions to download and setup tunnel binary can be found at the following links.

You can start tunnel by executing the below command in your cmd(Command Prompt) / terminal. Make sure that your pointer is routed in the same directory where you extract the downloaded LambdaTest Tunnel zip file.

So for example, if your user login email is [email protected] and your user key is 123asd123, then the command would be:

How To Mark Tests As Pass Or Fail

While performing automation testing using Selenium with Robot framework on LambdaTest selenium grid, you might want to flag a test as either pass or fail. This can be done if it is required in the testing requirements to validate the expected behaviour of tests. So you can mark any test as pass or fail, representing the expected outcome of that respective test. Below is the script that shows how to mark tests as pass or fail for validation:

LambdaTest Annotation

Parallel Testing using Robot Testing Framework

Parallel Testing is one of the most demanding feature of LambdaTest Selenium Grid. By parallel testing, you can run more than one test case, simultaneously. This means that, Parallel testing would allow you to execute numerous automation test cases altogether. So you execute a single test scenario across different browsers or could run different test scenarios across the same browser but with different browser versions.

To perform parallel Robot Selenium testing on LambdaTest’s Online grid use the below command.