Robot Framework Code - VS Code Extension

VS Code extension for Robot Framework - Create and manage Robot Framework projects with ease.
Requirements
- Python 3.8+ and Robot Framework 7.2+
- Visual Studio Code with Python extension
- Robot Framework Language Server (recommended)
Installing
Robot Framework Code can be installed from the Visual Studio Marketplace or as a .vsix.
To get a .vsix, run vsce package
in the project directory.
See: Install from a vsix for details installing a .vsix into VSCode.
Configuration
Robot Framework Code is designed to work out of the box without additional configuration. The extension automatically:
- Detects and validates Python interpreters
- Configures VSCode settings for Robot Framework
- Sets up Python paths for both VENV and Poetry environments
- Configures Robot Framework Language Server integration
All configuration is handled automatically during the "Install Environment" process.
Features (0.1.0)
Environment Setup
- Install Environment: Interactive command to configure complete Robot Framework environment
- Support for VENV and POETRY dependency management
- Automatic installation of project-specific libraries
- Automatic VSCode and Robot Framework Language Server configuration
Project Types Supported
- API: RequestsLibrary for API testing ✅ Fully implemented
- WEB: BrowserLibrary for web testing 🔄 Coming in future updates
- MOBILE: AppiumLibrary for mobile testing 🔄 Coming in future updates
API Keyword Generation
- Generate Keywords From Swagger: Generate keywords from Swagger/OpenAPI URL
- Generate Keywords from Swagger JSON: Generate keywords from local JSON file
- Generate Keywords from cURL: Generate keywords from cURL commands
- Automatic API session creation
- Python contract generation for complex payloads
- Multi-environment configuration (dev, hml, sdb, prd)
Project Structure
- API: Complete structure with automatic directory creation ✅ Fully implemented
- WEB & MOBILE: Basic structure creation 🔄 Coming in future updates
- Organized resource management
Commands
Command |
Description |
Robot Framework Code: Install Environment |
Configure Robot Framework environment |
Robot Framework Code: [API] Generate Keywords From Swagger |
Generate keywords from Swagger URL |
Robot Framework Code: [API] Generate Keywords from Swagger JSON |
Generate keywords from JSON file |
Robot Framework Code: [API] Generate Keywords from cURL |
Generate keywords from cURL command |
Usage Examples
Setting up Environment for API Testing
- Open a folder in VS Code
- Execute
Robot Framework Code: Install Environment
- Select API as project type
- Choose VENV as environment manager
- Wait for automatic configuration
Note: WEB and MOBILE project types are coming in future updates. Currently, only API projects are fully supported.
Generating Keywords for Petstore API
- Execute
Robot Framework Code: [API] Generate Keywords From Swagger
- Enter:
https://petstore.swagger.io/v2/swagger.json
- Configure session:
- Application name:
petstore
- Session alias:
petstore_session
- Environments: dev, hml, sdb, prd
- Extension will generate keywords for all endpoints
Generating Keyword from cURL
- Execute
Robot Framework Code: [API] Generate Keywords from cURL
- Paste the command:
curl -X POST "https://api.example.com/users" \
-H "Content-Type: application/json" \
-d '{"name": "John", "email": "john@example.com"}'
- Enter name:
Create User
- Extension will generate keyword with parameters and Python contract
Project Structure
API Project
api-project/
├── tests/ # Stores test suites
├── resources/
│ ├── connections/ # Responsible for files and keywords related to connections
│ ├── routes/ # Responsible for storing keywords that execute API endpoints
│ └── contracts/ # Responsible for storing Python libs that build request bodies
├── session.resource # Responsible for creating API sessions
├── session_data.yml # Responsible for storing session data, separated by environments
├── base.resource # Responsible for imports and environment control variables
└── requirements.txt (or pyproject.toml)
Web Project
web-project/
├── tests/ # Created automatically
├── resources/ # Created automatically
└── requirements.txt (or pyproject.toml)
Mobile Project
mobile-project/
├── tests/ # Created automatically
├── resources/ # Created automatically
└── requirements.txt (or pyproject.toml)
Dependencies by Project Type
API
robotframework>=7.2
robotframework-requests>=1.0a14
pyyaml>=6.0
WEB
robotframework>=7.2
robotframework-browser>=19.7.0
pyyaml>=6.0
MOBILE
robotframework>=7.2
robotframework-appiumlibrary>=3.0.0
pyyaml>=6.0
Poetry Support
When selecting POETRY as environment manager:
- Project Description: Will be requested for the project
- Automatic Initialization:
poetry init
command will be executed automatically
- Project Name: Will use the workspace folder name
- Dependencies: Will automatically install Robot Framework and specific libraries
- Robust Configuration: Will configure Poetry Python interpreter in VSCode with validation
Python Interpreter Validation
The extension includes robust Python interpreter validation to avoid common issues:
For Poetry
- ✅ Automatic Detection: Uses
poetry env info --path
to get correct path
- ✅ Validation: Verifies if interpreter exists and works
- ✅ Fallback: Multiple detection strategies to ensure compatibility
- ✅ Complete Configuration: Includes all necessary VSCode settings
Automatic Settings
{
"python.defaultInterpreterPath": "path/to/poetry/python",
"python.pythonPath": "path/to/poetry/python",
"python.terminal.activateEnvironment": true,
"python.terminal.activateEnvInCurrentTerminal": true,
"python.analysis.extraPaths": ["./src"],
"python.analysis.autoImportCompletions": true,
"robotframework.language-server.python": "path/to/poetry/python"
}
Roadmap
✅ Completed
- [x] Robot Framework environment installation
- [x] VENV and Poetry support
- [x] Swagger keyword generation (URL and JSON)
- [x] cURL keyword generation
- [x] Automatic API session creation
- [x] Python contract generation
- [x] Automatic VSCode configuration
- [x] Multi-environment support
🔄 In Development
- [ ] Web testing with BrowserLibrary
- [ ] Test recording
- [ ] Locator debugging
- [ ] Advanced templates
📋 Planned
- [ ] Mobile testing with Appium
- [ ] CI/CD integration
- [ ] Custom reports
- [ ] Multi-browser support
Contributing
Contributions are welcome! To contribute:
- Fork the project
- Create a feature branch
- Commit your changes
- Open a Pull Request
Reporting Issues
If you encounter problems or have questions:
- Verify Python is installed and in PATH
- Ensure Python and Robot Framework LSP extensions are installed
- Open an issue on GitHub with problem details
License
This project is licensed under the MIT License. See the LICENSE file for details.
Support
For support and questions:
- Check if Python is installed and in PATH
- Make sure Python and Robot Framework LSP extensions are installed
- Open an issue on GitHub with problem details
Developed with ❤️ for the Robot Framework community