Selenium With Geb
Run Geb tests on the TestMu AI cloud grid. This guide covers setup, running a sample test, configuring capabilities, and testing locally hosted pages.
All the code used in this guide is available in the sample repository.
Prerequisites
Make sure you have the following set up before you start.
- Create a TestMu AI account if you don't have one.
- Get your Username and Access Key from the TestMu AI Dashboard.
- Install the Java development environment (Java 11 recommended).
- Install Maven. Download it from the official website or install it on Linux/MacOS using Homebrew.
Step 1: Clone the Sample Project
Pull the sample repo to your local machine and navigate into the project directory.
git clone https://github.com/LambdaTest/geb-parallel-sample-code
cd geb-parallel-sample-code
Compile Maven dependencies:
mvn compile
You may also want to run the command below to check for outdated dependencies.
mvn versions:display-dependency-updates
Step 2: Set Your Credentials
Add your TestMu AI credentials as environment variables so the test can authenticate with the grid.
Visit the TestMu AI Dashboard, navigate to the left sidebar, and select Credentials. Copy your Username and Access Key, then set them as environment variables:
- macOS / Linux
- Windows
export LT_USERNAME="undefined"
export LT_ACCESS_KEY="undefined"
set LT_USERNAME="undefined"
set LT_ACCESS_KEY="undefined"
Step 3: Configure Your Test Capabilities
Define the browser, version, and OS for your test run.
Update the capabilities.json file with your desired browser, version, and platform:
{
"build": "GebFirstTest",
"platformName": "Windows 10",
"browserName": "firefox",
"browserVersion": "latest"
}
Use the Capabilities Generator to auto-generate capabilities for any browser, version, and OS combination.
Step 4: Run the Test
Trigger the test from your terminal.
./run.sh
mvn -Dlambdageb.capabilities=capabilities clean test
Step 5: View Your Results
Check the Automation Dashboard to see exactly what happened during your test.
Visit the TestMu AI Automation Dashboard to see your test results. Each session includes:
- Video recording of the full test execution
- Screenshots captured at each step
- Console logs from the browser
- Network logs for every request and response
- Selenium command logs showing each driver action
Run Geb Tests Using Agent Skills
Use AI coding assistants to generate and run Geb tests with the TestMu AI Agent Skill.
The geb-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/geb-skill .claude/skills/
# For Cursor / Copilot
cp -r agent-skills/geb-skill .cursor/skills/
Install all available framework skills at once by cloning the repository directly into your tool's skills directory (e.g., .claude/skills/, .cursor/skills/).
