skills/arvind3/skills/robot-framework-py

robot-framework-py

SKILL.md

Robot Framework (Python)

Use this skill to produce deterministic, maintainable Robot Framework code for API and service-level automation.

Apply this project structure by default

tests/
resources/
libraries/
variables/
  • Place suite files in tests/.
  • Place reusable keywords in resources/.
  • Place custom Python keyword libraries in libraries/.
  • Place environment-specific variable files in variables/.

Generate valid Robot Framework files

  • Emit standard sections when creating suite files:
    • *** Settings ***
    • *** Variables *** (when variables are needed)
    • *** Test Cases ***
    • *** Keywords *** (when local keywords are needed)
  • Emit reusable sections only when creating .resource files:
    • *** Settings ***
    • *** Variables *** (optional)
    • *** Keywords ***
  • Prefer BuiltIn assertions (Should Be Equal, Should Contain, Should Be True) over ad-hoc assertion logic.

Design for scale and reuse

  • Keep test cases short and move repeated flows into resource keywords.
  • Use Suite Setup and Suite Teardown for shared lifecycle steps.
  • Apply consistent tags (for example: smoke, api, regression, domain tags).
  • Keep secrets out of source files; read secrets from environment variables or secure variable files.

Use standard libraries deliberately

  • Use BuiltIn for assertions, logging, and control flow.
  • Use OperatingSystem for file and environment checks.
  • Use Collections, String, Process, and XML libraries only when their keywords are explicitly needed.
  • Name imported libraries explicitly in *** Settings ***.

Follow the RequestsLibrary API testing path

  • Install with pip install robotframework-requests.
  • Create sessions with Create Session.
  • Reuse sessions for related requests.
  • Build auth headers and common request data in reusable keywords.
  • Assert both HTTP status and critical response fields.

Minimal RequestsLibrary example

*** Settings ***
Library    RequestsLibrary

*** Variables ***
${BASE_URL}    https://api.example.com

*** Test Cases ***
Get Health Endpoint
    Create Session    api    ${BASE_URL}
    ${resp}=    GET On Session    api    /health
    Should Be Equal As Integers    ${resp.status_code}    200

Implement Python keyword libraries safely

  • Keep each keyword focused on one responsibility.
  • Return values in simple serializable types whenever possible.
  • Raise clear assertion failures for invalid inputs or state.

Module-style keyword library

from robot.api.deco import keyword

@keyword("Normalize Text")
def normalize_text(value: str) -> str:
    return " ".join(value.split()).strip().lower()

Class-style keyword library

from robot.api.deco import keyword

class MathKeywords:
    @keyword("Add Integers")
    def add_integers(self, left: int, right: int) -> int:
        return int(left) + int(right)

Prevent hallucinations

  • State which library provides each non-trivial keyword pattern.
  • If a keyword or library is not built in and not explicitly requested, label it as external or optional.
  • Do not present unknown keywords as standard Robot Framework keywords.

Execute with this checklist

  1. Identify output type (.robot suite, .resource, or Python library file).
  2. Identify required libraries (BuiltIn, OperatingSystem, RequestsLibrary, custom library).
  3. Choose variable and secret handling approach.
  4. Generate deterministic assertions and reusable keywords.
  5. Refactor duplication into resource files.
  6. Add run commands only when requested.

References

Weekly Installs
3
Repository
arvind3/skills
First Seen
Feb 15, 2026
Installed on
codex3
opencode2
gemini-cli2
antigravity2
claude-code2
github-copilot2