AutoMouser is a Chrome extension that intelligently tracks user interactions and automatically generates Selenium test code using OpenAI's GPT model. It simplifies the process of creating automated tests by recording your browser actions and converting them into robust, maintainable Python Selenium scripts. This project is built upon the work in bitmarte/selenium-rfc-chrome-extension.
- 🎯 Real-time interaction tracking (clicks, inputs, scrolls)
- 🤖 Automatic Selenium Python code generation
- 📝 Smart input consolidation
- 🔄 Window resize detection
- 💾 JSON action log export
- ✨ Multiple XPath generation strategies
- 🎨 Clean, well-structured code output
- Clone this repository or download the source code
- Replace
OPENAI_API_KEY
inbackground.js
with your actual API key and customize the prompt template inSELENIUM_PROMPT
if needed - Open Chrome and navigate to
chrome://extensions/
- Enable "Developer mode" in the top right
- Click "Load unpacked" and select the extension directory
- Click the AutoMouser icon in your Chrome toolbar to start recording
- Perform the actions you want to automate
- Click the icon again to stop recording and generate code
- Two files will be downloaded:
tracking_log.json
: Raw interaction dataselenium_test.py
: Generated Selenium test script
- Check and run the generated Selenium code in your Python environment!
Contributions are welcome! Please feel free to submit pull requests, create issues, or suggest improvements. For any issues, please create an issue in the repository.