An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

          

# Mark 1 - Natural Language to Robot Framework

![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)
![Python](https://img.shields.io/badge/Python-3.9%2B-green.svg)
![Robot Framework](https://img.shields.io/badge/Robot%20Framework-6.0%2B-orange.svg)
![Docker](https://img.shields.io/badge/Docker-Required-blue.svg)

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**