AutoMouser: Generating Browser Automation Code to Convert Mouse Actions to Selenium Python Scripts via AI
General Introduction
AutoMouser is a Chrome extension that intelligently tracks user interactions and automatically generates Selenium test code using OpenAI's GPT models. It simplifies the process of creating automated tests by recording user browser actions and converting them into robust, maintainable Python Selenium scripts.AutoMouser is designed to capture every click, drag, and hover to optimize workflow and build reliable, repeatable tests.
Function List
- Real-time interaction tracking (clicking, typing, scrolling)
- Auto-generating Selenium Python code
- Smart Input Merge
- Window resizing detection
- JSON operation log export
- Multiple XPath generation strategies
- Clean, well-structured code output
Using Help
Installation process
- Clone this repository or download the source code.
- Create an .env file in the root directory and add your OpenAI API key:OPENAI_API_KEY=your_openai_api_keyThe
- If necessary, replace SELENIUM_PROMPT in background.js with the prompt template you want.
- Open Chrome and navigate to chrome://extensions/The
- Enable "Developer Mode" in the upper right corner.
- Click on "Load Extended Extensions" and select the extension directory.
Usage Process
- Click the AutoMouser icon in the 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 data
- selenium_test.py: Generated Selenium test scripts
 
Run the generated Selenium code
- Examine and run the generated Selenium code in your Python environment.
- Make sure you have the necessary Python packages installed, such as seleniumcap (a poem)openaiThe
© Copyright notes
Article copyright AI Sharing Circle  All, please do not reproduce without permission.
Related articles
No comments...





 English
English  简体中文
简体中文  日本語
日本語  한국어
한국어  Русский
Русский  Español
Español