Skip to content
Skillpedia
Testing48k Β· #5711

selenium-skill

What it does

This tool creates automated test code for websites. It helps verify if a website is working correctly by simulating user actions.

When to use it

  • βœ“When you want to test if a website works across multiple browsers.
  • βœ“When you need to create automated tests to ensure website quality.
  • βœ“When you want to simulate website usage to find errors.

Skill link

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/selenium-skill/SKILL.md

Copy it and paste it into your AI (Claude, ChatGPT or Cursor), asking it to follow the instructions.

How to use

The easiest way: copy the message and paste it into your AI. It reads the skill and follows the instructions.

Ready-to-paste message

Use this skill to help me: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/selenium-skill/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
Want your AI to find skills like this on its own?Install the free Skillpedia MCP: one line, and it searches 15,000+ skills before each task.Install in 1 minute β†’

Example of what to ask your AI

β€œCreate an automated test in Java to check the login on website X.”

5 new skills a week. 1 minute to read.

How it works

You choose the programming language and where the test will run (on your computer or in the cloud). The tool generates code following best practices to ensure tests are reliable and easy to maintain.

Technical content (original SKILL.md)

Original text by the author, straight from GitHub.

Selenium Automation Skill

When to Use

Use this skill when you need generates production-grade Selenium WebDriver automation scripts and tests in Java, Python, JavaScript, C#, Ruby, or PHP. Supports local execution and TestMu AI cloud with 3000+ browser/OS combinations. Use when the user asks to write Selenium tests, automate with WebDriver, run...

You are a senior QA automation architect. You write production-grade Selenium WebDriver scripts and tests that run locally or on TestMu AI cloud.

Step 1 β€” Execution Target

User says "automate" / "test my site"
β”‚
β”œβ”€ Mentions "cloud", "TestMu", "LambdaTest", "Grid", "cross-browser", "real device"?
β”‚  └─ TestMu AI cloud (RemoteWebDriver)
β”‚
β”œβ”€ Mentions specific combos (Safari on Windows, old browsers)?
β”‚  └─ Suggest TestMu AI cloud
β”‚
β”œβ”€ Mentions "locally", "my machine", "ChromeDriver"?
β”‚  └─ Local execution
β”‚
└─ Ambiguous? β†’ Default local, mention cloud for broader coverage

Step 2 β€” Language Detection

Signal Language Config
Default / no signal Java Maven + JUnit 5
"Python", "pytest", ".py" Python pip + pytest
"JavaScript", "Node", ".js" JavaScript npm + Mocha/Jest
"C#", ".NET", "NUnit" C# NuGet + NUnit
"Ruby", ".rb", "RSpec" Ruby gem + RSpec
"PHP", "Codeception" PHP Composer + PHPUnit

For non-Java languages β†’ read reference/<language>-patterns.md

Step 3 β€” Scope

Request Type Action
"Write a test for X" Single test file, inline setup
"Set up Selenium project" Full project with POM, config, base classes
"Fix/debug test" Read reference/debugging-common-issues.md
"Run on cloud" Read reference/cloud-integration.md

Core Patterns β€” Java (Default)

Locator Priority

1. By.id("element-id")           ← Most stable
2. By.name("field-name")         ← Form elements
3. By.cssSelector(".class")      ← Fast, readable
4. By.xpath("//div[@data-testid]") ← Last resort

NEVER use: fragile XPaths like //div[3]/span[2]/a, absolute paths.

Wait Strategy β€” CRITICAL

// βœ… ALWAYS use explicit waits
WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(10));
WebElement element = wait.until(ExpectedConditions.elementToBeClickable(By.id("submit")));

// ❌ NEVER use Thread.sleep() or implicit waits mixed with explicit
Thread.sleep(3000); // FORBIDDEN
driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(10)); // Don't mix

Anti-Patterns

Bad Good Why
Thread.sleep(5000) Explicit WebDriverWait Flaky, slow
Implicit + explicit waits Only explicit waits Unpredictable timeouts
driver.findElement() without wait Wait then find NoSuchElementException
Absolute XPath Relative CSS/ID Breaks on DOM changes
No driver.quit() Always quit() in finally/teardown Leaks browsers

Basic Test Structure

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.By;
import org.openqa.selenium.support.ui.WebDriverWait;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.junit.jupiter.api.*;
import java.time.Duration;

public class LoginTest {
    private WebDriver driver;
    private WebDriverWait wait;

    @BeforeEach
    void setUp() {
        driver = new ChromeDriver();
        wait = new WebDriverWait(driver, Duration.ofSeconds(10));
        driver.manage().window().maximize();
    }

    @Test
    void testLogin() {
        driver.get("https://example.com/login");
        wait.until(ExpectedConditions.visibilityOfElementLocated(By.id("username")))
            .sendKeys("user@test.com");
        driver.findElement(By.id("password")).sendKeys("password123");
        driver.findElement(By.cssSelector("button[type='submit']")).click();
        wait.until(ExpectedConditions.urlContains("/dashboard"));
        Assertions.assertTrue(driver.getTitle().contains("Dashboard"));
    }

    @AfterEach
    void tearDown() {
        if (driver != null) driver.quit();
    }
}

Page Object Model β€” Quick Example

// pages/LoginPage.java
public class LoginPage {
    private WebDriver driver;
    private WebDriverWait wait;

    private By usernameField = By.id("username");
    private By passwordField = By.id("password");
    private By submitButton  = By.cssSelector("button[type='submit']");


…
FAQ

What is Selenium WebDriver?

It's a tool that allows controlling a browser (like Chrome or Firefox) through code, simulating clicks, typing, and other actions.

What is the 'cloud' in this context?

It's an online service that provides many computers with different browsers and operating systems to run your tests, ensuring the website works across various combinations.

Why use 'waits' in the code?

Web pages load at different times. Using waits ensures the code waits for the correct element to appear or become ready before interacting with it, preventing errors.

Details

Original description by the author

Generates production-grade Selenium WebDriver automation scripts and tests in Java, Python, JavaScript, C#, Ruby, or PHP. Supports local execution and TestMu AI cloud with 3000+ browser/OS combinations.

repo: sickn33/agentic-awesome-skills

Popularity

GitHub stars
48k
Ranking position
#5711
License
MIT
Updated
10/15/2026

Is this skill useful?

0

Sign in to vote.

Comments

  • …

More skills from this repository

Similar skills