All skills
fugazi avatar

/webapp-selenium-testing

@ef704d5

Author and maintain versioned Selenium WebDriver tests with Java and JUnit 5. Use for creating, debugging, or running Selenium specs, implementing Page Objects, handling explicit waits, capturing screenshots, or setting up Maven test projects. Supports Chrome, Firefox, and Edge. Keywords: Selenium WebDriver, Java, JUnit 5, Page Object Model, explicit waits, Maven, screenshots.

Use this Skill: https://skilld.dev/gh/fugazi/test-automation-skills-agents/webapp-selenium-testing

This session only. Nothing lands on disk.

referenceswait-strategies-basics.md

≈598 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Wait Strategies Basics

Part of the webapp-selenium-testing skill. See SKILL.md for full context.

Related: this file was split from the original wait-strategies.md. See the other related files in this folder.

Comprehensive guide for implementing proper synchronization in Selenium tests using explicit waits.

The Golden Rule

NEVER use Thread.sleep() - Always use explicit waits with WebDriverWait and ExpectedConditions.

Why Thread.sleep() is Bad

Problem Impact
Fixed delay Wastes time when element is ready sooner
Flaky tests Still fails if element takes longer
No condition check Just waits blindly
Unpredictable Different machines have different speeds
Hard to maintain Magic numbers everywhere
// [no] NEVER DO THIS
Thread.sleep(3000);
element.click();

// [ok] ALWAYS DO THIS
wait.until(ExpectedConditions.elementToBeClickable(element)).click();

WebDriverWait Setup

Basic Configuration

import org.openqa.selenium.support.ui.WebDriverWait;
import org.openqa.selenium.support.ui.ExpectedConditions;
import java.time.Duration;

// Standard wait with 15 second timeout
WebDriverWait wait = new WebDriverWait(driver, Duration.ofSeconds(15));

// With custom polling interval (default is 500ms)
WebDriverWait wait = new WebDriverWait(
    driver,
    Duration.ofSeconds(15),      // timeout
    Duration.ofMillis(250)       // polling interval
);

In BasePage Class

public abstract class BasePage {
    protected final WebDriver driver;
    protected final WebDriverWait wait;
    protected final WebDriverWait shortWait;
    protected final WebDriverWait longWait;

    private static final Duration DEFAULT_TIMEOUT = Duration.ofSeconds(15);
    private static final Duration SHORT_TIMEOUT = Duration.ofSeconds(5);
    private static final Duration LONG_TIMEOUT = Duration.ofSeconds(30);

    protected BasePage(WebDriver driver) {
        this.driver = driver;
        this.wait = new WebDriverWait(driver, DEFAULT_TIMEOUT);
        this.shortWait = new WebDriverWait(driver, SHORT_TIMEOUT);
        this.longWait = new WebDriverWait(driver, LONG_TIMEOUT);
    }
}

Source: SKILL.md on GitHub

1 warning13d4 checks · Risk SAFE
  • Gen Agent Trust Hub13d

    The skill provides templates and scripts for Selenium WebDriver testing in Java. It is categorized as low risk due to potential indirect prompt injection vulnerabilities inherent in browser automation and the use of JavaScript execution in the browser context.

  • Socket13d

    No alerts

  • Snyk13d

    Risk: LOW · No issues

  • Runlayer6mo

    1/6 files flagged

Signed by skilld at ef704d5. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 4 days ago.

Activeupdated 2 months ago

README badge

README badge for fugazi/test-automation-skills-agents/webapp-selenium-testing