home / skills / partme-ai / full-stack-skills / selenium
This skill provides comprehensive guidance for Selenium WebDriver, helping you automate browsers, write reliable tests, and master locators and waits.
npx playbooks add skill partme-ai/full-stack-skills --skill seleniumReview the files below or copy the command above to add this skill to your agents.
---
name: selenium
description: Provides comprehensive guidance for Selenium WebDriver including browser automation, element location, waits, and test frameworks. Use when the user asks about Selenium, needs to automate web browsers, write Selenium tests, or work with Selenium WebDriver.
license: Complete terms in LICENSE.txt
---
## When to use this skill
Use this skill whenever the user wants to:
- [待完善:根据具体工具添加使用场景]
## How to use this skill
[待完善:根据具体工具添加使用指南]
## Best Practices
[待完善:根据具体工具添加最佳实践]
## Keywords
[待完善:根据具体工具添加关键词]
This skill provides practical, hands-on guidance for using Selenium WebDriver to automate web browsers, locate elements, manage waits, and integrate with test frameworks. It focuses on Python examples, common patterns, and troubleshooting tips to help you build reliable browser automation and end-to-end tests. The content is aimed at developers and QA engineers who need actionable steps and clear examples.
The skill inspects typical Selenium workflows and explains how to start a WebDriver session, find elements with robust selectors, use explicit and implicit waits, and handle common browser interactions (clicks, inputs, navigation). It demonstrates how to structure tests using pytest or unittest, manage browser drivers, and capture logs or screenshots for debugging. The guidance highlights anti-flakiness patterns and cross-browser considerations.
Do I need a separate browser driver binary?
Yes. For most browsers you need the matching driver binary (chromedriver, geckodriver). Use tools like webdriver-manager or webdriver-manager-python to download and manage drivers automatically.
Should I use implicit or explicit waits?
Prefer explicit waits (WebDriverWait with expected_conditions) for specific element states. Implicit waits can cause unpredictable interactions when combined with explicit waits.
How do I reduce flaky tests?
Stabilize selectors, use explicit waits for asynchronous content, avoid hard sleeps, isolate test data, and run tests against reproducible environments (containers or dedicated test accounts).