From rf-agentskills
Guides creation of Browser Library tests using Playwright-powered automation for web testing, covering locators, auto-waiting, assertions, iframes, Shadow DOM, and multi-tabs.
npx claudepluginhub manykarim/robotframework-agentskills --plugin rf-agentskillsThis skill uses the workspace's default tool permissions.
Browser Library uses Playwright for fast, reliable browser automation with built-in auto-waiting and powerful assertion capabilities.
assets/examples/authentication-flow.robotassets/examples/basic-web-test.robotassets/examples/file-operations.robotassets/examples/form-handling.robotassets/examples/iframe-shadow-dom.robotreferences/assertion-engine.mdreferences/authentication-storage.mdreferences/browser-context-page.mdreferences/downloads-uploads.mdreferences/iframes-shadow-dom.mdreferences/keywords-reference.mdreferences/locators.mdreferences/tabs-windows.mdreferences/troubleshooting.mdGenerates Robot Framework tests using SeleniumLibrary for Selenium WebDriver browser automation, web UI testing, form interactions, multi-window/frames handling, and JavaScript execution.
Provides best practices for browser automation using Playwright and Puppeteer in web testing, scraping, and AI agents. Covers selectors, auto-waits, isolation, screenshots, and anti-detection.
Automates browser tasks and E2E testing with Playwright: auto-detects dev servers, generates scripts for pages, forms, screenshots, responsive design, UX validation, login flows, cross-browser checks in TypeScript/JavaScript/Python projects.
Share bugs, ideas, or general feedback.
Browser Library uses Playwright for fast, reliable browser automation with built-in auto-waiting and powerful assertion capabilities.
pip install robotframework-browser
rfbrowser init
*** Settings ***
Library Browser auto_closing_level=KEEP
Import options:
auto_closing_level=KEEP - Keep browser open between tests (faster)auto_closing_level=TEST - Close after each test (clean state)timeout=30s - Default timeout for operationsenable_presenter_mode=true - Slow down for demosBrowser (chromium/firefox/webkit)
└── Context (isolated session: cookies, storage)
└── Page (single tab/window)
New Browser chromium headless=false
New Context viewport={'width': 1920, 'height': 1080}
New Page https://example.com
Browser Library automatically waits for elements to be actionable before interacting. No explicit waits needed in most cases.
New Browser chromium headless=false
New Context viewport={'width': 1920, 'height': 1080}
New Page https://example.com
Go To https://example.com/login
Reload
Go Back
Go Forward
# CSS (default)
Click button.submit
Click #login-btn
Click [data-testid="submit"]
# Text
Click text=Login
Click "Login" # Exact text match
# XPath
Click xpath=//button[@type='submit']
# Chained selectors (powerful!)
Click .form >> button.submit
Click #container >> text=Save
# nth-match
Click button >> nth=0 # First button
Click button >> nth=-1 # Last button
# Role selectors (accessibility)
Click role=button[name="Submit"]
Fill Text input#username myuser
Type Text input#password secret123 delay=50ms
Check Checkbox #remember-me
Uncheck Checkbox #newsletter
Select Options By select#country value US
Select Options By select#country label United States
Clear Text input#search
${text}= Get Text h1.title
${value}= Get Property input#email value
${attr}= Get Attribute a.link href
${count}= Get Element Count li.item
${states}= Get Element States button#submit
Get Text h1 == Welcome
Get Text .message contains Success
Get Text .message *= Success # Alternative
Get Element Count li.item > 5
Get Url contains /dashboard
Get Title == Home Page
Take Screenshot # Current viewport
Take Screenshot fullPage=true # Full page
Take Screenshot selector=#main # Specific element
Take Screenshot filename=test.png # Named file
Wait For Elements State .results visible timeout=10s
Wait For Elements State .spinner hidden
Wait For Response **/api/data timeout=30s
Wait For Navigation url=*/success
Wait For Load State networkidle
data-testid, data-test, data-cy attributes - Most stablerole=button[name="Submit"]button.submit, #login-btntext=Login, "Exact Text"xpath=//button[@type='submit']*** Keywords ***
Login As User
[Arguments] ${username} ${password}
New Page ${LOGIN_URL}
Fill Text input[name="username"] ${username}
Fill Text input[name="password"] ${password}
Click button[type="submit"]
Get Url contains /dashboard
Click button#load-data
Wait For Response **/api/data timeout=10s
Get Text .data-container != ${EMPTY}
Click button#submit
Wait For Elements State .loading-spinner hidden timeout=30s
Get Text .result contains Success
Fill Text input#email invalid-email
Click button[type="submit"]
Get Text .error-message contains valid email
Clear Text input#email
Fill Text input#email valid@example.com
Click button[type="submit"]
Get Url contains /success
*** Settings ***
Library Browser auto_closing_level=TEST
Test Teardown Run Keyword If Test Failed Take Screenshot
# Fill Text - set input value directly (fast, fires change event)
Fill Text input#username myuser
# Fill Secret - same as Fill Text but value is NOT logged (for passwords)
Fill Secret input#password $password
# Type Text - simulate real keystrokes with optional delay
Type Text input#search query delay=50ms
# Type Secret - simulate keystrokes without logging the value
Type Secret input#password $password delay=50ms
# Keyboard Key - press, hold, or release a key (no selector needed, browser-level)
Keyboard Key press Enter
Keyboard Key press Control+c
Keyboard Key down Shift
Keyboard Key up Shift
# Keyboard Input - type text at browser level (no selector needed)
Keyboard Input type Hello World
Keyboard Input insertText pasted content
# Wait For Condition - custom JavaScript wait condition
Wait For Condition Element States h1 contains visible
# Wait Until Network Is Idle - wait for all network requests to complete
Wait Until Network Is Idle timeout=10s
# Get Elements - returns a list of matching element handles
@{buttons}= Get Elements button.action
Length Should Be ${buttons} 3
# Promise To Upload File - handle file dialogs triggered by non-input clicks
${promise}= Promise To Upload File ${CURDIR}/myfile.txt
Click button#custom-upload
${upload}= Wait For ${promise}
# Click With Options - click with modifiers, position, force, etc.
Click With Options button#action delay=100ms
Click With Options canvas#game position_x=100 position_y=200
Click With Options button#submit force=true
Click With Options a#link button=right
Click With Options div#item clickCount=2
Load these reference files when you need deeper knowledge:
| Need | Reference File |
|---|---|
| Complex locators, chaining, nth-match | references/locators.md |
| Assertion operators, retry logic | references/assertion-engine.md |
| Browser/Context/Page management | references/browser-context-page.md |
| Complete keyword reference | references/keywords-reference.md |
| iframes and Shadow DOM | references/iframes-shadow-dom.md |
| Multiple tabs/windows | references/tabs-windows.md |
| Session persistence, cookies | references/authentication-storage.md |
| File download/upload | references/downloads-uploads.md |
| Debugging test failures | references/troubleshooting.md |
| Need | Skill |
|---|---|
| Generate user keywords | keyword-builder |
| Generate test cases | testcase-builder |
| Design resource file layout | resource-architect |
| Search for keywords across libraries | libdoc-search |
| Explain keyword arguments in detail | libdoc-explain |
| Parse test results from output.xml | results |