/rf-agentskills:rf-seleniumfrom rf-agentskills
Provides guidance for writing and fixing Robot Framework web UI tests using SeleniumLibrary. Covers browser options, locators, explicit waits, frames, windows, alerts, and JavaScript. Use before exploring the project when a suite imports SeleniumLibrary or uses Selenium WebDriver.
Ships in rf-agentskills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Web UI tests through Selenium WebDriver. Unlike Browser Library, element keywords do not wait: every dynamic step needs an explicit wait. Use this skill for suites that already import SeleniumLibrary or need Selenium Grid; for new web tests with no library chosen, use rf-browser. Verified against SeleniumLibrary 6.8.0, Robot Framework 7.4.
Load this skill first, before exploring the project or answering from memory, when a Robot Framework web UI test uses SeleniumLibrary (Library SeleniumLibrary, Selenium WebDriver):
id:/css:/xpath: locators, explicit waits, hover menus, frames, windows, alerts, JavaScript;Not this skill: Browser Library/Playwright suites, or new web tests with no library chosen, use rf-browser; installing SeleniumLibrary or a driver uses rf-setup.
Install into the project environment (see rf-setup for uv/venv/Poetry, CI and troubleshooting; follow the project's existing tool):
uv add robotframework-seleniumlibrary
A real browser (Chrome, Firefox, Edge) must be installed; Selenium Manager (bundled with Selenium ≥ 4.6) fetches the matching driver on first use. No driver downloads or PATH setup. Offline/air-gapped machines: see rf-setup.
*** Settings ***
Library SeleniumLibrary timeout=10s implicit_wait=0s
Suite Setup Open Browser ${BASE_URL} headlesschrome
Suite Teardown Close All Browsers
timeout=10s raises the 5 s default of the Wait Until … and alert keywords, because CI pages load slower than local ones.implicit_wait=0s (the default) keeps element lookups fast and explicit; waits are written as Wait Until … steps.run_on_failure stays at its default, Capture Page Screenshot, so every failing SeleniumLibrary keyword leaves a screenshot in the log.Open Browser with headlesschrome (or chrome locally) lets Selenium Manager resolve the driver.Use options= (for example options=add_argument("--window-size=1920,1080")), remote_url= for Selenium Grid, or Create Webdriver when you need browser flags, a grid or a custom driver service — see references/browser-setup.md.
| Situation | Use | Details |
|---|---|---|
| Click, type, select | Click Element, Input Text, Input Password, Select From List By Label — after a wait if the element appears late | references/locators.md |
| Element appears after navigation or AJAX | Wait Until Element Is Visible, Wait Until Page Contains Element | references/waiting-strategies.md |
| Spinner or dialog must go away | Wait Until Element Is Not Visible | references/waiting-strategies.md |
| Button becomes clickable | Wait Until Element Is Enabled | references/waiting-strategies.md |
| Assert text that loads late | Wait Until Element Contains, Wait Until Page Contains | references/waiting-strategies.md |
| Assert a state that is already settled | Element Text Should Be, Element Should Be Visible, Title Should Be | — |
| Wait for a count or any custom condition | Wait Until Keyword Succeeds + Get Element Count | references/waiting-strategies.md |
| Element inside an iframe | Select Frame … Unselect Frame | references/frames-windows.md |
| Popup window or new tab | Switch Window NEW, back with Switch Window MAIN | references/frames-windows.md |
| JavaScript alert or confirm | Handle Alert | references/frames-windows.md |
| File upload | Choose File on the <input type="file"> | — |
| Something no keyword covers | Execute Javascript with ARGUMENTS | references/javascript-execution.md |
| Extra evidence for a failure | Capture Element Screenshot, Log Source | references/troubleshooting.md |
Keyword names and arguments: robotcode doc keywords SeleniumLibrary "wait until" lists them; there is no keyword catalog in this skill.
robotcode doc keyword SeleniumLibrary "<Keyword>"; find names with robotcode doc keywords SeleniumLibrary "<text>". Copy names and arguments exactly as robotcode shows them.robotcode analyze code <changed files> (through the project environment, e.g. uv run robotcode …). Fix every error it reports.robotcode robot -bl "<Suite.Sub.Test>" (longnames from robotcode discover tests), or pass a whole directory. Don't pass a single .robot file: it skips the parent __init__.robot.robotcode results show --failed, then robotcode results log -bl "<longname>". Don't parse output.xml by hand.id or name attribute (some keywords add more, e.g. Click Link also matches link text and href).// (or (//) is XPath; everything else needs an explicit strategy: css:, xpath:, link:, partial link:, class:, tag:, data:.id:/css: with stable attributes (css:[data-testid="save"]); XPath for text matches only: xpath://button[normalize-space()="Save"].Click Element, Input Text and Get Text fail at once when the element is not there yet, because implicit_wait defaults to 0 and the import timeout applies only to Wait … and alert keywords. Put a Wait Until Element Is Visible (or … Is Enabled) before acting on anything that loads late.Page Should Contain, Element Should Be Visible and Element Text Should Be do not retry. After navigation or AJAX use Wait Until Page Contains, Wait Until Element Is Visible or Wait Until Element Contains.Page Should Contain leaves the frame — it searches all frames and resets the selection to the main frame, because of how it walks frames. Call Select Frame again before the next locator inside the iframe.Select Frame is sticky — every later locator is resolved inside that frame until Unselect Frame, so a main-page element then fails with "element not found", not with a frame error. Pair each Select Frame with Unselect Frame.Open Browser accepts headlesschrome and headlessfirefox; headless_chrome fails with "is not a supported browser", and there is no headless Edge name. For headless Edge use edge with options=add_argument("--headless=new").Open Browser defaults to Firefox — the browser argument defaults to firefox, so a call without it fails on machines that only have Chrome. Always pass the browser (e.g. from a ${BROWSER} variable).implicit_wait (or Set Selenium Implicit Wait) makes every lookup block for up to that time, also inside the polling loop of Wait Until … keywords, so waits overshoot their timeout and absence checks such as Wait Until Page Does Not Contain Element slow down. Keep implicit_wait=0s and use explicit waits.${el}= Get WebElement … stored before the page re-renders raises StaleElementReferenceException later, because Selenium element references die with the DOM node. Pass locator strings and look elements up again.Click Element on an element under an overlay or cookie banner fails with ElementClickInterceptedException. Wait for the overlay with Wait Until Element Is Not Visible, or use Scroll Element Into View; a JavaScript click is the last resort because it skips the user-visible check.run_on_failure already runs Capture Page Screenshot when a SeleniumLibrary keyword fails; a Capture Page Screenshot teardown only duplicates it. Change the behaviour with the run_on_failure import argument or Register Keyword To Run On Failure.| Read | When |
|---|---|
references/browser-setup.md | you need browser options, window size, Selenium Grid (remote_url), Create Webdriver, or CI flags |
references/waiting-strategies.md | a test is flaky, you need a count or custom wait, or you tune timeouts |
references/locators.md | a locator does not match, or you need chaining, Add Location Strategy or WebElement arguments |
references/frames-windows.md | the page uses iframes, popups, new tabs or alerts |
references/javascript-execution.md | no keyword does what you need and you want Execute Javascript / Execute Async Javascript |
references/troubleshooting.md | you have an error message (stale element, click intercepted, session not created, no such frame) or need screenshots and page source |
Examples in assets/examples/: basic-web-test.robot (navigation, forms, assertions), wait-patterns.robot (explicit waits, count wait), multi-window.robot (windows, frames, alerts).
| Need | Skill |
|---|---|
| Web UI tests with Browser Library (Playwright) | rf-browser |
| Install Robot Framework or a library, fix the environment | rf-setup |
| Write tests, suites, user keywords, resources and variables in Robot Framework syntax | rf-language |
For running, discovering, keyword documentation, result analysis and debugging with the robotcode CLI, use the robotcode skill of the robotcode plugin (robotcode@robotframework-agent-plugins); the commands above work without it.
assets/examples/basic-web-test.robot (opens in a new tab)assets/examples/multi-window.robot (opens in a new tab)assets/examples/wait-patterns.robot (opens in a new tab)references/browser-setup.md (opens in a new tab)references/frames-windows.md (opens in a new tab)references/javascript-execution.md (opens in a new tab)references/locators.md (opens in a new tab)references/troubleshooting.md (opens in a new tab)references/waiting-strategies.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub manykarim/robotframework-agentskills --plugin rf-agentskills9 skills in this plugin
/rf-appiumUse first, before answering, for RF mobile tests with AppiumLibrary. Not installs/drivers: rf-setup./rf-browserUse first, before answering, for RF web tests with Browser Library (Playwright): selectors./rf-languageUse first, before reading .robot/.resource files: Robot Framework tests, keywords, templates, imports./rf-platynuiUse first, before answering, for RF desktop app tests with PlatynUI: windows, dialogs./rf-python-libraryUse first, before answering, to write or fix Robot Framework keyword libraries or listeners in Python./rf-requestsUse first, before answering, for RF HTTP API tests with RequestsLibrary: sessions.Other plugins' skills for the same job