$npx -y skills add LambdaTest/agent-skills --skill robot-framework-skillGenerates 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
| 1 | # Robot Framework Skill |
| 2 | |
| 3 | For TestMu AI cloud execution, see [reference/cloud-integration.md](reference/cloud-integration.md) and [shared/testmu-cloud-reference.md](../shared/testmu-cloud-reference.md). |
| 4 | |
| 5 | ## Core Patterns |
| 6 | |
| 7 | ### Basic Test (tests/login.robot) |
| 8 | |
| 9 | ```robot |
| 10 | *** Settings *** |
| 11 | Library SeleniumLibrary |
| 12 | Suite Setup Open Browser ${BASE_URL} chrome |
| 13 | Suite Teardown Close All Browsers |
| 14 | |
| 15 | *** Variables *** |
| 16 | ${BASE_URL} http://localhost:3000 |
| 17 | ${EMAIL} user@test.com |
| 18 | ${PASSWORD} password123 |
| 19 | |
| 20 | *** Test Cases *** |
| 21 | Login With Valid Credentials |
| 22 | Go To ${BASE_URL}/login |
| 23 | Wait Until Element Is Visible id:email 10s |
| 24 | Input Text id:email ${EMAIL} |
| 25 | Input Text id:password ${PASSWORD} |
| 26 | Click Button css:button[type='submit'] |
| 27 | Wait Until Element Is Visible css:.dashboard 10s |
| 28 | Page Should Contain Welcome |
| 29 | Location Should Contain /dashboard |
| 30 | |
| 31 | Login With Invalid Credentials Shows Error |
| 32 | Go To ${BASE_URL}/login |
| 33 | Input Text id:email wrong@test.com |
| 34 | Input Text id:password wrong |
| 35 | Click Button css:button[type='submit'] |
| 36 | Wait Until Element Is Visible css:.error 5s |
| 37 | Element Should Contain css:.error Invalid credentials |
| 38 | ``` |
| 39 | |
| 40 | ### Custom Keywords |
| 41 | |
| 42 | ```robot |
| 43 | *** Keywords *** |
| 44 | Login As User |
| 45 | [Arguments] ${email} ${password} |
| 46 | Go To ${BASE_URL}/login |
| 47 | Input Text id:email ${email} |
| 48 | Input Text id:password ${password} |
| 49 | Click Button css:button[type='submit'] |
| 50 | |
| 51 | Verify Dashboard Is Displayed |
| 52 | Wait Until Element Is Visible css:.dashboard 10s |
| 53 | Page Should Contain Welcome |
| 54 | |
| 55 | *** Test Cases *** |
| 56 | Valid Login Flow |
| 57 | Login As User user@test.com password123 |
| 58 | Verify Dashboard Is Displayed |
| 59 | ``` |
| 60 | |
| 61 | ### Data-Driven Tests (Template) |
| 62 | |
| 63 | ```robot |
| 64 | *** Test Cases *** |
| 65 | Login With Various Users |
| 66 | [Template] Login And Verify |
| 67 | admin@test.com admin123 Dashboard |
| 68 | user@test.com pass123 Dashboard |
| 69 | bad@test.com wrong Error |
| 70 | |
| 71 | *** Keywords *** |
| 72 | Login And Verify |
| 73 | [Arguments] ${email} ${password} ${expected} |
| 74 | Login As User ${email} ${password} |
| 75 | Page Should Contain ${expected} |
| 76 | ``` |
| 77 | |
| 78 | ### API Testing (RequestsLibrary) |
| 79 | |
| 80 | ```robot |
| 81 | *** Settings *** |
| 82 | Library RequestsLibrary |
| 83 | |
| 84 | *** Test Cases *** |
| 85 | Get Users Returns 200 |
| 86 | ${response}= GET ${API_URL}/users expected_status=200 |
| 87 | Should Not Be Empty ${response.json()['users']} |
| 88 | |
| 89 | Create User |
| 90 | ${body}= Create Dictionary name=Alice email=alice@test.com |
| 91 | ${response}= POST ${API_URL}/users json=${body} expected_status=201 |
| 92 | Should Be Equal ${response.json()['name']} Alice |
| 93 | ``` |
| 94 | |
| 95 | ### Cloud Config |
| 96 | |
| 97 | ```robot |
| 98 | *** Settings *** |
| 99 | Library SeleniumLibrary |
| 100 | |
| 101 | *** Variables *** |
| 102 | ${REMOTE_URL} https://%{LT_USERNAME}:%{LT_ACCESS_KEY}@hub.lambdatest.com/wd/hub |
| 103 | |
| 104 | *** Keywords *** |
| 105 | Open Cloud Browser |
| 106 | ${caps}= Create Dictionary |
| 107 | ... browserName=chrome browserVersion=latest |
| 108 | ... LT:Options=${{{"build":"Robot Build","name":"Login Test","platform":"Windows 11","video":True}}} |
| 109 | Open Browser ${BASE_URL} remote_url=${REMOTE_URL} desired_capabilities=${caps} |
| 110 | ``` |
| 111 | |
| 112 | ## Setup: `pip install robotframework robotframework-seleniumlibrary robotframework-requests` |
| 113 | ## Run: `robot tests/` or `robot --include smoke tests/` |
| 114 | ## Report: `report.html` and `log.html` auto-generated |
| 115 | |
| 116 | ## Deep Patterns |
| 117 | |
| 118 | See `reference/playbook.md` for production-grade patterns: |
| 119 | |
| 120 | | Section | What You Get | |
| 121 | |---------|-------------| |
| 122 | | §1 Project Setup | Project structure, variable files, execution commands, pabot | |
| 123 | | §2 Web UI Testing | Login tests with Page Objects, dynamic content, waits, modals | |
| 124 | | §3 API Testing | CRUD with RequestsLibrary, error handling, validation, auth | |
| 125 | | §4 Data-Driven Testing | DataDriver with CSV, FOR loops, bulk operations | |
| 126 | | §5 Custom Python Libraries | @keyword decorator, resource tracking, test data generation | |
| 127 | | §6 Browser Library | Playwright-based modern testing, network interception, responsive | |
| 128 | | §7 LambdaTest Integration | Remote browser config, cross-browser suite, status reporting | |
| 129 | | §8 CI/CD Integration | GitHub Actions with matrix strategy, pabot parallel, report merging | |
| 130 | | §9 Debugging Table | 12 common problems with causes and fixes | |
| 131 | | §10 Best Practices | 14-item Robot Framework checklist | |