Run Selenium Tests Using Agent Skills
Instead of manually setting up your Selenium project, use Agent Skills to let your AI coding assistant generate production-ready test automation for you. The selenium-skill is part of TestMu AI Agent Skills - structured packages that teach AI assistants how to write production-grade test code.
What Are Agent Skills?
Self-contained packages of instructions, code patterns, and configurations for specific testing frameworks.
Once installed, your AI assistant works like a senior QA automation architect with knowledge of:
- Proper project structure for each framework
- Correct dependency versions and configurations
- Both local and TestMu AI cloud execution patterns
- Common pitfalls and debugging approaches
- CI/CD integration with GitHub Actions
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 an AI coding assistant: Claude Code, GitHub Copilot, Cursor, Gemini CLI, or any compatible tool.
Step 1: Install the Selenium Agent Skill
Clone the repository and copy the Selenium skill into your AI tool's skills directory.
git clone https://github.com/LambdaTest/agent-skills.git
# For Claude Code
cp -r agent-skills/selenium-skill .claude/skills/
# For Cursor
cp -r agent-skills/selenium-skill .cursor/skills/
# For GitHub Copilot
cp -r agent-skills/selenium-skill .github/skills/
# For Gemini CLI
cp -r agent-skills/selenium-skill .gemini/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/).
Step 2: Set Your Credentials
Add your TestMu AI credentials as environment variables so the generated tests 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 run:
export LT_USERNAME="YOUR_LAMBDATEST_USERNAME"
export LT_ACCESS_KEY="YOUR_LAMBDATEST_ACCESS_KEY"
Step 3: Run Your First Test
Ask your AI assistant to write tests in natural language.
"Write Selenium tests for the login page and run them on TestMu AI cloud using Chrome and Firefox"
"Set up a Selenium Java project with TestNG, Page Object Model, and run tests on TestMu AI"
"Execute Selenium tests across 5 browsers in parallel on TestMu AI, tag the build as 'release-v1.0'"
The Agent Skill automatically handles:
- Project setup - Creates the right folder structure, dependencies, and config files
- Language detection - Maps your request to the correct language (Java, Python, JavaScript, C#, Ruby, or PHP)
- Execution target - Configures local or TestMu AI cloud execution based on your request
- Best practices - Uses explicit waits, proper locator strategies, and Page Object Model patterns
What's Included in the Selenium Skill
A breakdown of everything the skill package contains.
selenium-skill/
├── SKILL.md
└── reference/
├── playbook.md
└── advanced-patterns.md
| Section | Details |
|---|---|
| Project Setup | Dependencies, versions, configuration files, project structure |
| Core Patterns | Complete, runnable code examples with best practices |
| Cloud Integration | TestMu AI RemoteWebDriver and capabilities configuration |
| CI/CD Integration | GitHub Actions workflows with reporting and parallel execution |
| Debugging Guide | 11+ common exceptions mapped to solutions |
| Best Practices | 14+ actionable recommendations for production code |
Supported Languages and Frameworks
The Selenium Agent Skill supports 6 languages. Each framework below also has its own dedicated Agent Skill with framework-specific patterns.
Java
| Framework | Agent Skill | Documentation |
|---|---|---|
| TestNG | testng-skill | TestNG with Selenium |
| JUnit 5 | junit-5-skill | JUnit with Selenium |
| Cucumber | cucumber-skill | Cucumber with Selenium |
| Selenide | selenide-skill | Selenide Framework |
| Gauge | gauge-skill | Gauge Framework |
| Geb | geb-skill | Geb Framework |
| Serenity BDD | serenity-bdd-skill | Serenity BDD |
JavaScript
| Framework | Agent Skill | Documentation |
|---|---|---|
| Mocha | mocha-skill | Mocha with Selenium |
| Jest | jest-skill | Jest with Selenium |
| WebdriverIO | webdriverio-skill | WebdriverIO |
| Nightwatch.js | nightwatchjs-skill | Nightwatch.js |
| Protractor | protractor-skill | Protractor |
| TestCafe | testcafe-skill | TestCafe |
| Jasmine | jasmine-skill | Jasmine with Karma |
| Karma | karma-skill | Karma Integration |
| CucumberJS | cucumber-skill | CucumberJS |
| NemoJS | nemojs-skill | NemoJS |
C#
| Framework | Agent Skill | Documentation |
|---|---|---|
| NUnit | nunit-skill | NUnit with Selenium |
| MSTest | mstest-skill | MSTest with Selenium |
| xUnit | xunit-skill | xUnit with Selenium |
| SpecFlow | specflow-skill | SpecFlow with Selenium |
Python
| Framework | Agent Skill | Documentation |
|---|---|---|
| pytest | pytest-skill | pytest with Selenium |
| unittest | unittest-skill | unittest |
| Robot Framework | robot-framework-skill | Robot Framework |
| Behave | behave-skill | Behave with Selenium |
| Lettuce | lettuce-skill | Lettuce with Selenium |
PHP
| Framework | Agent Skill | Documentation |
|---|---|---|
| PHPUnit | phpunit-skill | PHPUnit |
| Behat | behat-skill | Behat |
| Laravel Dusk | laravel-dusk-skill | Laravel Dusk |
| Codeception | codeception-skill | Codeception |
Ruby
| Framework | Agent Skill | Documentation |
|---|---|---|
| RSpec | rspec-skill | RSpec |
| Capybara | capybara-skill | Capybara |
| Test::Unit | testunit-skill | Test::Unit |
Supported AI Tools
Pick the tool you use and install the skill to the corresponding path.
| Tool | Type | Installation Path |
|---|---|---|
| Claude Code | CLI | .claude/skills/ |
| GitHub Copilot | Extension | .github/skills/ |
| Cursor | IDE | .cursor/skills/ |
| Gemini CLI | CLI | .gemini/skills/ |
| Codex CLI | CLI | .codex/skills/ |
| OpenCode | CLI | .opencode/skills/ |
| Claude.ai | Web | Settings > Features > Skills |
