Skip to main content

Selenium With Robot Framework


Run Robot Framework tests on the TestMu AI cloud grid. This guide covers setup, running a sample test, configuring capabilities, and testing locally hosted pages.

Sample repo

All the code used in this guide is available in the sample repository.

Prerequisites


Complete these steps before running your first Robot Framework Selenium test.

  1. Install the latest Python build from the official website.
  2. Verify that pip is installed in your system. Install pip from official pip documentation.
  3. Download the latest Selenium Client and its WebDriver bindings from the official website.
  4. Install virtualenv to isolate the build from other setups and ensure tests run with the specified module versions.
pip install virtualenv

Step 1: Clone the Sample Project


Clone the repository and set up the environment.

git clone https://github.com/LambdaTest/Robot-Selenium-Sample
cd Robot-Selenium-Sample

Create a virtual environment and activate it:

virtualenv venv
source venv/bin/activate

Install the required packages:

pip install -r requirements.txt

Step 2: Set Your Credentials


Configure your credentials to connect to the TestMu AI Selenium Grid.

Set TestMu AI Username and Access Key in environment variables.

export LT_USERNAME="undefined"
export LT_ACCESS_KEY="undefined"

Step 3: Configure Your Test Capabilities


Define browser, version, and OS settings for your test run.

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

*** Settings ***
Library Selenium2Library

*** Variables ***

@{_tmp}
... browserName: %{browserName},
... platformName: %{platform},
... browserVersion: %{version},
... name: RobotFramework Lambda Test

${BROWSER} %{ROBOT_BROWSER}
${CAPABILITIES} ${EMPTY.join(${_tmp})}
${KEY} <YOUR_LAMBDATEST_USERNAME>:<YOUR LAMBDATEST ACCESS KEY>
${REMOTE_URL} https://${KEY}@hub.lambdatest.com/wd/hub


*** Keywords ***

Open test browser
Open browser https://lambdatest.github.io/sample-todo-app/ browser=${BROWSER}
... remote_url=${REMOTE_URL}
... desired_capabilities=${CAPABILITIES}

Close test browser
Close all browsers
Capabilities Generator

Use the TestMu AI Capabilities Generator to auto-generate the capabilities class for your test requirements.

Step 4: Run the Test


Execute the Robot Framework test from the command line.

make test_Windows_10_chrome_latest

To run parallel tests:

make run_all_in_parallel

Step 5: View Your Results


Check the test output on the console and the TestMu AI dashboard.

Visit the TestMu AI Automation Dashboard to view your test results. The dashboard provides:

  • Text logs for each test step
  • Screenshots captured during execution
  • Video recordings of the full test session

Run Robot Framework Tests Using Agent Skills


Use AI coding assistants to generate and run Robot Framework tests with the TestMu AI Agent Skill.

The robot-framework-skill is part of TestMu AI Agent Skills - structured packages that teach AI coding assistants how to write production-grade test automation.

Install the skill:

git clone https://github.com/LambdaTest/agent-skills.git
cp -r agent-skills/robot-framework-skill .claude/skills/

# For Cursor / Copilot
cp -r agent-skills/robot-framework-skill .cursor/skills/
tip

Install all available framework skills at once by cloning the repository directly into your tool's skills directory (e.g., .claude/skills/, .cursor/skills/).

Test across 3000+ combinations of browsers, real devices & OS.

Book Demo

Help and Support

Related Articles