Click on the image below to watch the demo video:
Promptwright is an AI-powered tool that transforms natural-language user prompts into automated browser workflows while generating reusable test automation scripts. It bridges no-code simplicity with pro-code efficiency.
- Natural Language Processing: Convert plain English instructions into automated browser actions with the help of LLMs and generate reusable test automation scripts as byproducts.
- Multi-Framework Support: Generate code for:
- Playwright (TypeScript & Python)
- Cypress (TypeScript)
- Selenium (Java)
- Multiple AI Model Support:
- OpenAI (GPT-4, GPT-4o-mini, GPT-4o)
- Anthropic (Claude 3.5 Haiku, Claude 3.5 Sonnet)
- DeepSeek Chat
- Groq (Mixtral-8x7b, LLaMA-3.3-70b)
- Google (Gemini 2.0 Flash, Gemini 1.5 Pro)
- Vision Capabilities: Optional AI vision features for enhanced visual understanding
- Flexible Browser Execution:
- Local browser execution
- Remote browser execution via cloud providers:
- Browserbase
- Steel.dev
- Browserless
- Lightpanda
- Interactive Web Interface: User-friendly Streamlit interface with:
- Real-time code generation
- Task execution recording playback
- Interactive elements table with CSV export
- Professional-Grade Output: Generate production-ready automation scripts
- Element Locator Information: Provides detailed element interaction data including:
- CSS selectors
- XPath locators
- CSV export functionality for element data
- Make sure you have Python 3.11+ installed
- Clone this repository:
git clone https://github.com/yourusername/promptwright.git cd promptwright
- Install the requirements:
pip install -r requirements.txt
- Set up your environment:
- Copy
.env.example
to.env
- Configure your model preferences:
MODEL_PROVIDER=openai # Options: 'openai', 'anthropic', 'deepseek', 'groq', 'google' MODEL_NAME=gpt-4 # Model options vary by provider: # - OpenAI: 'gpt-4', 'gpt-4o-mini', 'gpt-4o' # - Anthropic: 'claude-3-5-haiku-20241022', 'claude-3-5-sonnet-20241022' # - DeepSeek: 'deepseek-chat' # - Groq: 'mixtral-8x7b-32768', 'llama-3.3-70b-versatile' # - Google: 'gemini-2.0-flash', 'gemini-1.5-pro'
- Add your API keys:
OPENAI_API_KEY=your_openai_api_key_here ANTHROPIC_API_KEY=your_anthropic_api_key_here DEEPSEEK_API_KEY=your_deepseek_api_key_here GROQ_API_KEY=your_groq_api_key_here GOOGLE_API_KEY=your_google_api_key_here
- For remote browser execution, configure cloud provider API keys:
BROWSERBASE_API_KEY=your_browserbase_api_key_here STEELDEV_API_KEY=your_steeldev_api_key_here BROWSERLESS_API_KEY=your_browserless_api_key_here LIGHTPANDA_API_KEY=your_lightpanda_api_key_here
- Make sure Chrome is installed on your system for local browser execution
- Copy
Launch the Streamlit app with:
streamlit run src/app.py
The application will be available at http://localhost:8501
by default.
Promptwright can be run as a Docker container, with Chrome browser and Playwright pre-installed in the image.
-
Build the Docker image:
docker build -t promptwright:0.1 .
-
Run the container:
docker run -p 8080:8080 --name promptwright_container promptwright:0.1
-
Access the application at
http://localhost:8080
- The Docker image includes:
- Chrome browser
- Playwright with all dependencies
- Required system libraries
- Python environment
- All browser automation executes inside the container
- No need to install Chrome or Playwright on your host machine
- To rebuild and restart in one command:
docker rm -f promptwright_container || true && docker build -t promptwright:0.1 . && docker run -p 8080:8080 --name promptwright_container promptwright:0.1
- Configure your preferences in the sidebar:
- Select AI model provider and model
- Choose browser execution mode (local/remote)
- Select target framework for code generation
- Enter your automation task in natural language
- Click "Go 🚀" to start the process
- Watch as Promptwright:
- Executes the task in a browser
- Records the actions
- Generates clean, reusable code in your chosen framework
- Provides an interactive elements table
- Download the generated code and elements data for future use
- Visit a website and fill out registration forms
- Perform search operations on websites
- Navigate through web applications
- Interact with UI elements (buttons, forms, etc.)
- Verify content and validate data
- Visit https://thinking-tester-contact-list.herokuapp.com/, login with 'testronai.com@gmail.com' as username and 'password' as password and submit. Then click 'Add a New Contact', fill in the contact form with random Indian-style data, and verify the contact details are correctly displayed in the table. Then logout from the application.
- Go to https://thinking-tester-contact-list.herokuapp.com/ and enter using any random funny username and password and do not submit the form.
- Go to google.com and search for 'testronai', and open the first link which has the word testronai in it.
- Go to testronai.com and click on watch demo button
- Python 3.11+
- Chrome browser (for local execution)
- Internet connection
- API key(s) for chosen AI model provider
- API key for cloud browser provider (if using remote execution)
- Ensure Chrome is installed for local browser execution
- Keep your API keys secure and never commit them to version control
- Generated scripts require appropriate framework setup to run independently:
- Node.js/Playwright for TypeScript scripts
- Python/Playwright for Python scripts
- Node.js/Cypress for Cypress scripts
- Java/Selenium for Java scripts
This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0) - see the LICENSE file for details.
- ✔️ You can view and use this code for personal and educational purposes
- ✔️ You can modify the code
- ✔️ You must preserve the copyright and license notices
- ✔️ You must disclose the source code when distributing the software
- ✔️ Changes must be released under the same license
- ❌ You cannot use this code for commercial purposes without explicit permission
- ❌ No warranty is provided
For more information about the AGPL-3.0 license, please visit: https://www.gnu.org/licenses/agpl-3.0.en.html
We welcome contributions to Promptwright! Here's how you can help:
- Fork the repository
- Create a new branch for your feature or bugfix:
git checkout -b feature/your-feature-name # or git checkout -b fix/your-bugfix-name
- Make your changes
- Write or update tests as needed
- Run tests locally to ensure everything passes
- Commit your changes:
git commit -m "feat: add your feature description" # or git commit -m "fix: fix your bug description"
- Push to your fork:
git push origin feature/your-feature-name
- Open a Pull Request
- Follow Python PEP 8 style guide for Python code
- Add comments and documentation for new features
- Update the README.md if you're adding or changing functionality
- Update the README.md with details of changes if applicable
- Update the requirements.txt if you've added new dependencies
- Ensure your PR description clearly describes the problem and solution
- Link any related issues in your PR description
- Request review from maintainers
- Use the GitHub issue tracker to report bugs
- Include detailed steps to reproduce the issue
- Include browser version and OS if relevant
- Include screenshots if applicable
- Use issue templates if available
- Be respectful and inclusive
- Welcome newcomers
- Be patient with questions
- Provide constructive feedback
- Focus on what is best for the community
- Bug fixes
- Documentation improvements
- New test automation framework support
- Performance optimizations
- New cloud browser provider integrations
- UI/UX improvements
- Test coverage improvements
Feel free to:
- Open a GitHub Discussion
- Join our Discord server
- Check existing issues and discussions before creating new ones
Thank you for contributing to Promptwright! 🚀