# robot-to-playwright-converter

> Most 'migrations' rewrite your tests from scratch. This one maps your existing keywords and locators automatically.

robot-to-playwright-converter is a free AI agent skill on Agensi by Matthew King, in Testing & Debugging. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [Matthew King](https://www.agensi.io/creators/subverted)
- Category: [Testing & Debugging](https://www.agensi.io/skills/testing-debugging)
- Uses: 9
- Version: 1.0
- Last updated: 2026-05-31
- Security: scan passed (2026-05-31); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/robot-to-playwright-converter
- Tags: testing, playwright, robot-framework, typescript, test-automation

## About this skill

### Migrate from Robot Framework to Playwright with Intelligence

Moving a legacy test suite from Robot Framework to Playwright is a massive undertaking. This skill automates the heavy lifting by converting `.robot` files into idiomatic, high-quality Playwright TypeScript. It doesn't just swap syntax; it understands test intent, preserves BDD structures, and maps complex Robot keywords to web-first Playwright assertions.

### What it does

- Converts Robot Framework test cases and keywords into modern Playwright specs.

- Intelligently handles `SeleniumLibrary`, `Browser Library`, and `RequestsLibrary` mappings.

- Detects and preserves original test styles, whether they are BDD (Given/When/Then) or procedural.

- Translates Robot's complex variable syntax and control flows (FOR, IF, WHILE) into clean TypeScript.

- Generates necessary scaffolding including `playwright.config.ts` and `package.json` if missing.

### Why developers use this skill

Unlike basic search-and-replace scripts, this skill acts like an experienced QA engineer. It prioritizes "web-first" assertions that reduce flakiness and automatically identifies opportunities for Page Object Models. It handles the nuances of the Playwright lifecycle, such as ensuring browser contexts are managed correctly in suite setups, preventing common migration pitfalls like `SecurityError` in teardowns.

### Output format

The result is a set of compilable `.spec.ts` files. Any custom Python libraries or ambiguous locators that cannot be safely converted are automatically flagged with `// TODO` comments, allowing you to finalize the migration without losing context.

## Requires

- Playwright
- Node.js

## Known limitations

- Cannot convert custom Python keyword libraries.
- Complex dynamic XPath/CSS locators may require manual fix.
- Limited support for Robot Framework 3.x legacy syntax.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the robot-to-playwright-converter skill from Agensi" and describe your task.
3. Your agent loads the skill from Agensi when it needs it. Nothing is downloaded.

## Frequently asked questions

### What specific automation does this skill provide for test migrations?

The skill converts .robot files into idiomatic Playwright TypeScript code, automatically mapping syntax, BDD structures, and library calls (like SeleniumLibrary) into modern Playwright assertions.

### How does the skill handle different Robot Framework libraries?

The converter handles standard Robot Framework libraries like SeleniumLibrary, Browser Library, and RequestsLibrary, translating their logic into native Playwright and Axios-style requests.

### What happens if I have custom Python keywords or complex third-party libraries?

While it attempts to map custom keyword logic, complex Python-based libraries it cannot resolve are marked with clear // TODO comments so you can manually finalize the transition.

### Will my original test structure and BDD styles be preserved after conversion?

Yes, the skill is designed to recognize and preserve BDD (Given/When/Then) structures, converting them into organized Playwright test blocks or descriptive comments to maintain readability.

### What files will I receive at the end of the conversion process?

The output is a set of production-ready .spec.ts files, along with necessary scaffolding like playwright.config.ts and package.json to help you get your new suite running immediately.

### How are updates and new Playwright version support handled?

Updates to the conversion logic are provided periodically to support the latest Playwright features and Robot Framework keyword updates; these are automatically available through your AI agent interface.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
