跳到正文
Skillpedia
测试48k · #5646

robot-framework-skill

它能做什么

这项工具可以帮助你使用 Robot Framework 语言为网站和 API 创建自动化测试。它会生成 Python 代码,用来检查一切是否按预期运行。

适用场景

  • ✓当你需要为网站创建测试时。
  • ✓当你想检测 API 是否正确响应时。
  • ✓当你已经在使用或打算开始使用 Robot Framework 时。

技能链接

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/robot-framework-skill/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/robot-framework-skill/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“创建一个 Robot Framework 测试,用用户名和密码登录网站,并验证仪表盘页面会出现。”

每周 5 个新技能,1 分钟读完。

工作原理

你只需描述想要测试的内容,工具就会生成 Robot Framework 格式的代码。它会使用 Selenium 等库与网站交互,并使用 Requests 等库来测试 API。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

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

…

常见问题

什么是 Robot Framework?

它是一个开源框架,用于测试自动化和机器人流程自动化(RPA)。它的语法简单易读,接近自然语言。

它支持哪些库?

它支持 SeleniumLibrary(用于网页界面测试)和 RequestsLibrary(用于 API 测试)等常用库,也允许你使用自定义关键字。

我该如何运行生成的测试?

先运行 `pip install robotframework robotframework-seleniumlibrary robotframework-requests` 安装所需依赖,然后在终端中使用 `robot` 命令运行测试即可。

详情

作者的原始描述

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\".

repo: sickn33/agentic-awesome-skills

热度

GitHub 星标
48k
排名
#5646
许可证
MIT
更新时间
2026/10/15

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能