https://github.com/monkscode/natural-language-to-robot-framework
Turn plain English into Robot Framework files with AI. No dependencies, no hassle โ just validated, ready-to-run tests
https://github.com/monkscode/natural-language-to-robot-framework
agentic-framework ai-testing automation-framework docker fastapi generative-ai large-language-models llm-applications natural-language-processing nlp-to-code open-source python quality-assurance robotframework selenium software-testing test-automation
Last synced: about 1 month ago
JSON representation
Turn plain English into Robot Framework files with AI. No dependencies, no hassle โ just validated, ready-to-run tests
- Host: GitHub
- URL: https://github.com/monkscode/natural-language-to-robot-framework
- Owner: monkscode
- License: apache-2.0
- Created: 2024-11-21T18:41:59.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-09-21T10:25:06.000Z (about 2 months ago)
- Last Synced: 2025-09-21T12:20:25.630Z (about 2 months ago)
- Topics: agentic-framework, ai-testing, automation-framework, docker, fastapi, generative-ai, large-language-models, llm-applications, natural-language-processing, nlp-to-code, open-source, python, quality-assurance, robotframework, selenium, software-testing, test-automation
- Language: HTML
- Homepage:
- Size: 6.02 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Cla: CLA.md
Awesome Lists containing this project
README
# Mark 1 - Natural Language to Robot Framework




Transform natural language test descriptions into executable Robot Framework code using advanced AI agents. Mark 1 is an intelligent test automation platform that bridges the gap between human language and automated testing.
## โจ Key Features
- ๐ค **Multi-Agent AI System**: Sophisticated pipeline with specialized agents for planning, identification, validation, and self-correction
- ๐ **Self-Healing Tests**: Automatic error detection and correction through intelligent validation loops
- ๐ณ **Containerized Execution**: Clean, isolated test runs in Docker containers for consistent results
- ๐ **Flexible Model Support**: Works with both local LLMs (via Ollama) and cloud models (Google Gemini)
- ๐ **Detailed Reporting**: Comprehensive HTML logs and reports for easy debugging
- โก **Real-time Streaming**: Live progress updates and instant feedback
- ๐ฏ **Smart Element Detection**: AI-powered web element locator generation
## ๐๏ธ Architecture
Mark 1 employs a sophisticated multi-agent workflow:
1. **Step Planner Agent** - Decomposes natural language into structured test plans
2. **Element Identifier Agent** - Generates optimal web element locators
3. **Code Assembler Agent** - Creates syntactically correct Robot Framework code
4. **Validator Agent** - Ensures code quality and correctness
5. **Self-Correction Orchestrator** - Automatically fixes validation errors
## ๐ Quick Start
### Prerequisites
- **Python 3.9+** - [Download Python](https://python.org/downloads/)
- **Docker** - [Install Docker](https://docs.docker.com/get-docker/)
- **Git** - [Install Git](https://git-scm.com/downloads)
- **(Optional) Ollama** - For local AI models [Install Ollama](https://ollama.com/)
### Installation
1. **Clone the repository**
```bash
git clone
cd natural-language-robot-framework
```
2. **Configure your AI model**
```bash
cp backend/.env.example backend/.env
```
**For Google Gemini (Recommended)**:
```env
MODEL_PROVIDER=online
GEMINI_API_KEY="your-gemini-api-key-here"
ONLINE_MODEL=gemini-1.5-pro-latest
```
**For Local Models (Ollama)**:
```env
MODEL_PROVIDER=local
LOCAL_MODEL=llama3
```
3. **Start the application**
```bash
# Linux/macOS
chmod +x run.sh
./run.sh
# Windows (Git Bash)
bash run.sh
```
4. **Access the web interface**
Open your browser to `http://localhost:5000`
## ๐ก Usage Examples
Simply describe your test in natural language:
### Basic Examples
- *"Open Google, search for 'Robot Framework tutorials', and click the first result"*
- *"Navigate to GitHub, search for 'selenium automation', and star the top repository"*
- *"Go to YouTube, search for 'Python automation', and play the first video"*
### Advanced Examples
- *"Visit Amazon, search for 'wireless headphones', filter by rating above 4 stars, and add the top result to cart"*
- *"Open LinkedIn, search for 'QA Engineer' jobs in San Francisco, and apply filters for remote work"*
- *"Navigate to Stack Overflow, search for 'pytest fixtures', and upvote the most helpful answer"*
## ๐ ๏ธ Configuration
### Environment Variables
| Variable | Description | Default |
|----------|-------------|---------|
| `MODEL_PROVIDER` | AI model provider (`online` or `local`) | `online` |
| `GEMINI_API_KEY` | Google Gemini API key | Required for online |
| `ONLINE_MODEL` | Gemini model name | `gemini-1.5-pro-latest` |
| `LOCAL_MODEL` | Ollama model name | `llama3` |
| `SECONDS_BETWEEN_API_CALLS` | Rate limiting delay | `0` |
### Getting API Keys
**Google Gemini API Key**:
1. Visit [Google AI Studio](https://aistudio.google.com/app/apikey)
2. Create a new API key
3. Copy the key to your `.env` file
## ๐งช Testing
Test the API endpoint directly:
```bash
chmod +x test.sh
./test.sh
```
Or use curl:
```bash
curl -X POST \
-H "Content-Type: application/json" \
-d '{"query": "go to google.com and search for python tutorials", "model": "gemini-1.5-pro-latest"}' \
http://localhost:5000/generate-and-run
```
## ๐ Project Structure
```
โโโ backend/
โ โโโ main.py # FastAPI application
โ โโโ robot_generator.py # Multi-agent AI system
โ โโโ requirements.txt # Python dependencies
โ โโโ .env # Configuration
โโโ frontend/
โ โโโ index.html # Web interface
โ โโโ script.js # Frontend logic
โ โโโ style.css # Styling
โโโ robot_tests/ # Generated test files and reports
โโโ run.sh # Startup script
โโโ test.sh # Testing script
```
## ๐ Debugging
When tests fail, detailed logs are automatically saved:
- `robot_tests/{run_id}/log.html` - Step-by-step execution log
- `robot_tests/{run_id}/report.html` - High-level test report
- `robot_tests/{run_id}/output.xml` - Machine-readable results
Open `log.html` in your browser for comprehensive failure analysis.
## ๐ค Contributing
We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.
### Development Setup
1. Fork the repository
2. Create a feature branch: `git checkout -b feature/amazing-feature`
3. Make your changes
4. Run tests: `./test.sh`
5. Commit: `git commit -m 'Add amazing feature'`
6. Push: `git push origin feature/amazing-feature`
7. Open a Pull Request
Before contributing, please read our [Contributor License Agreement](CLA.md).
## ๐ License
This project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details.
## ๐ Support
- ๐ **Documentation**: Check this README and code comments
- ๐ **Issues**: Report bugs via GitHub Issues
- ๐ฌ **Discussions**: Join our GitHub Discussions
- ๐ง **Email**: Contact the maintainers
## ๐ฏ Roadmap
- [ ] Support for mobile app testing
- [ ] Integration with CI/CD pipelines
- [ ] Visual test result dashboards
- [ ] Multi-language test generation
- [ ] Advanced AI model fine-tuning
- [ ] Cloud deployment options
## โญ Show Your Support
If Mark 1 helps streamline your testing workflow, please consider:
- โญ Starring this repository
- ๐ Reporting issues
- ๐ก Suggesting new features
- ๐ค Contributing code
---
**Built with โค๏ธ for the test automation community**