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-best-practices.md

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

Wait Strategies Best Practices

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.

Quick Reference

Need ExpectedCondition
Element visible visibilityOfElementLocated(By)
Element clickable elementToBeClickable(By)
Element invisible invisibilityOfElementLocated(By)
Element exists in DOM presenceOfElementLocated(By)
Text present textToBePresentInElementLocated(By, text)
URL contains urlContains(urlPart)
Title contains titleContains(text)
Alert present alertIsPresent()
Frame available frameToBeAvailableAndSwitchToIt(By)
Element stale stalenessOf(element)
Multiple windows numberOfWindowsToBe(count)
Attribute value attributeToBe(By, attr, value)

Anti-Patterns to Avoid

// [no] Thread.sleep - NEVER!
Thread.sleep(5000);

// [no] Catching Exception to hide timing issues
try {
    element.click();
} catch (Exception e) {
    Thread.sleep(1000);
    element.click();
}

// [no] Using findElement without wait for dynamic content
WebElement element = driver.findElement(By.id("dynamic"));

// [no] Very long implicit wait
driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(60));

// [no] Polling in a loop manually
for (int i = 0; i < 10; i++) {
    if (element.isDisplayed()) break;
    Thread.sleep(500);
}

Best Practices Checklist

  • Never use Thread.sleep()
  • Use WebDriverWait with ExpectedConditions
  • Set reasonable timeouts (10-15 seconds default)
  • Use shorter waits for quick checks (3-5 seconds)
  • Use longer waits for file uploads/downloads (30+ seconds)
  • Create reusable wait methods in BasePage
  • Handle TimeoutException gracefully when appropriate
  • Use custom conditions for complex scenarios
  • Avoid mixing implicit and explicit waits
  • Wait before interacting, not after

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