Generate Robot Framework tests with keyword-driven syntax
Generates keyword-driven Robot Framework tests in Python, covering SeleniumLibrary UI tests, RequestsLibrary API tests, and data-driven templates.
Why it matters
Automate the creation of Robot Framework test suites in keyword-driven syntax for web UI and API testing, with support for SeleniumLibrary, RequestsLibrary, custom keywords, data-driven patterns, and cloud execution on LambdaTest.
Outcomes
What it gets done
Generate .robot test files with SeleniumLibrary for login flows, form validation, and dashboard verification
Create custom keywords and data-driven test templates for reusable test logic across multiple scenarios
Build API test suites using RequestsLibrary for CRUD operations, authentication, and response validation
Configure cloud browser execution with LambdaTest remote capabilities and CI/CD pipeline integration
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/ag-robot-framework-skill | bash Overview
Robot Framework Skill
This skill generates keyword-driven Robot Framework tests in Python covering SeleniumLibrary UI tests, RequestsLibrary API tests, custom keywords, data-driven test templates, and LambdaTest cloud execution config. Use it whenever Robot Framework, *** Test Cases ***, SeleniumLibrary, or a .robot file is mentioned, or keyword-driven UI/API tests are needed.
What it does
Generates Robot Framework tests in keyword-driven syntax with Python, covering SeleniumLibrary, RequestsLibrary, and custom keywords. Core patterns include a basic UI test suite with Suite Setup/Suite Teardown opening and closing the browser, explicit waits before interaction (Wait Until Element Is Visible), and both a happy-path login and an invalid-credentials-shows-error case; custom keywords that wrap repeated steps (a Login As User keyword taking email/password arguments, a Verify Dashboard Is Displayed keyword) so test cases read as short, readable flows; data-driven tests via the [Template] mechanism, where one Login And Verify keyword is run against multiple email/password/expected-result rows without repeating the test body; API testing with RequestsLibrary using GET/POST keywords, expected_status assertions, and JSON body dictionaries built with Create Dictionary; and cloud execution config pointing remote_url at a LambdaTest hub URL built from %{LT_USERNAME}/%{LT_ACCESS_KEY} environment variables with capabilities like browser name/version, platform, and video recording set via LT:Options. Setup is pip install robotframework robotframework-seleniumlibrary robotframework-requests, tests run via robot tests/ (or robot --include smoke tests/ to filter by tag), and report.html/log.html are generated automatically. A deeper reference playbook covers ten production-grade sections: project setup (structure, variable files, pabot parallel execution), web UI testing with Page Objects and dynamic content handling, API testing CRUD with error handling and auth, data-driven testing via DataDriver with CSV and FOR loops, custom Python libraries using the @keyword decorator, the Playwright-based Browser Library for modern testing with network interception, LambdaTest remote/cross-browser integration, CI/CD integration with GitHub Actions matrix strategy and parallel report merging, a 12-item debugging table of common problems and fixes, and a 14-item best-practices checklist.
*** Settings ***
Library SeleniumLibrary
Suite Setup Open Browser ${BASE_URL} chrome
Suite Teardown Close All Browsers
*** Variables ***
${BASE_URL} http://localhost:3000
${EMAIL} user@test.com
${PASSWORD} password123
*** Test Cases ***
Login With Valid Credentials
Go To ${BASE_URL}/login
Wait Until Element Is Visible id:email 10s
Input Text id:email ${EMAIL}
Input Text id:password ${PASSWORD}
Click Button css:button[type='submit']
Wait Until Element Is Visible css:.dashboard 10s
Page Should Contain Welcome
Location Should Contain /dashboard
When to use - and when NOT to
Use it whenever a user mentions Robot Framework, *** Test Cases *** syntax, SeleniumLibrary, or a .robot file, or wants keyword-driven UI or API tests written in Robot Framework's syntax.
Inputs and outputs
Input is a UI flow or API endpoint to test, or a set of data rows to test against. Output is a .robot test file with settings/variables/test cases (and custom keywords when reuse is needed), runnable via the robot CLI with auto-generated HTML report and log files.
Integrations
Uses SeleniumLibrary for browser UI testing, RequestsLibrary for API testing, the DataDriver library for CSV-driven tests, the Playwright-based Browser Library as a modern alternative, pabot for parallel execution, and LambdaTest's remote hub for cross-browser cloud execution.
Who it's for
QA engineers and developers writing Robot Framework tests who want correct keyword-driven syntax for UI, API, and data-driven test cases, plus a deeper playbook for production patterns like Page Objects, custom Python keywords, and CI/CD integration.
Source README
Robot Framework Skill
When to Use
Use this skill when you need generates Robot Framework tests in keyword-driven syntax with Python. Supports SeleniumLibrary, RequestsLibrary, and custom keywords. Use when user mentions "Robot Framework", "*** Test Cases ", "SeleniumLibrary", ".robot file". Triggers on: "Robot Framework", " Test Cases ***",...
For TestMu AI cloud execution, see reference/cloud-integration.md and shared/testmu-cloud-reference.md.
Core Patterns
Basic Test (tests/login.robot)
*** Settings ***
Library SeleniumLibrary
Suite Setup Open Browser ${BASE_URL} chrome
Suite Teardown Close All Browsers
*** Variables ***
${BASE_URL} http://localhost:3000
${EMAIL} user@test.com
${PASSWORD} password123
*** Test Cases ***
Login With Valid Credentials
Go To ${BASE_URL}/login
Wait Until Element Is Visible id:email 10s
Input Text id:email ${EMAIL}
Input Text id:password ${PASSWORD}
Click Button css:button[type='submit']
Wait Until Element Is Visible css:.dashboard 10s
Page Should Contain Welcome
Location Should Contain /dashboard
Login With Invalid Credentials Shows Error
Go To ${BASE_URL}/login
Input Text id:email wrong@test.com
Input Text id:password wrong
Click Button css:button[type='submit']
Wait Until Element Is Visible css:.error 5s
Element Should Contain css:.error Invalid credentials
Custom Keywords
*** Keywords ***
Login As User
[Arguments] ${email} ${password}
Go To ${BASE_URL}/login
Input Text id:email ${email}
Input Text id:password ${password}
Click Button css:button[type='submit']
Verify Dashboard Is Displayed
Wait Until Element Is Visible css:.dashboard 10s
Page Should Contain Welcome
*** Test Cases ***
Valid Login Flow
Login As User user@test.com password123
Verify Dashboard Is Displayed
Data-Driven Tests (Template)
*** Test Cases ***
Login With Various Users
[Template] Login And Verify
admin@test.com admin123 Dashboard
user@test.com pass123 Dashboard
bad@test.com wrong Error
*** Keywords ***
Login And Verify
[Arguments] ${email} ${password} ${expected}
Login As User ${email} ${password}
Page Should Contain ${expected}
API Testing (RequestsLibrary)
*** Settings ***
Library RequestsLibrary
*** Test Cases ***
Get Users Returns 200
${response}= GET ${API_URL}/users expected_status=200
Should Not Be Empty ${response.json()['users']}
Create User
${body}= Create Dictionary name=Alice email=alice@test.com
${response}= POST ${API_URL}/users json=${body} expected_status=201
Should Be Equal ${response.json()['name']} Alice
Cloud Config
*** Settings ***
Library SeleniumLibrary
*** Variables ***
${REMOTE_URL} https://%{LT_USERNAME}:%{LT_ACCESS_KEY}@hub.lambdatest.com/wd/hub
*** Keywords ***
Open Cloud Browser
${caps}= Create Dictionary
... browserName=chrome browserVersion=latest
... LT:Options=${{{"build":"Robot Build","name":"Login Test","platform":"Windows 11","video":True}}}
Open Browser ${BASE_URL} remote_url=${REMOTE_URL} desired_capabilities=${caps}
Setup: pip install robotframework robotframework-seleniumlibrary robotframework-requests
Run: robot tests/ or robot --include smoke tests/
Report: report.html and log.html auto-generated
Deep Patterns
See reference/playbook.md for production-grade patterns:
| Section | What You Get |
|---|---|
| §1 Project Setup | Project structure, variable files, execution commands, pabot |
| §2 Web UI Testing | Login tests with Page Objects, dynamic content, waits, modals |
| §3 API Testing | CRUD with RequestsLibrary, error handling, validation, auth |
| §4 Data-Driven Testing | DataDriver with CSV, FOR loops, bulk operations |
| §5 Custom Python Libraries | @keyword decorator, resource tracking, test data generation |
| §6 Browser Library | Playwright-based modern testing, network interception, responsive |
| §7 LambdaTest Integration | Remote browser config, cross-browser suite, status reporting |
| §8 CI/CD Integration | GitHub Actions with matrix strategy, pabot parallel, report merging |
| §9 Debugging Table | 12 common problems with causes and fixes |
| §10 Best Practices | 14-item Robot Framework checklist |
Limitations
- Use this skill only when the task clearly matches its upstream source and local project context.
- Verify commands, generated code, dependencies, credentials, and external service behavior before applying changes.
- Do not treat examples as a substitute for environment-specific tests, security review, or user approval for destructive or costly actions.
FAQ
Common questions
Discussion
Questions & comments · 0
Sign In Sign in to leave a comment.