AI Personal Learning
and practical guidance

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

  1. Clone this repository or download the source code.
  2. Create an .env file in the root directory and add your OpenAI API key:OPENAI_API_KEY=your_openai_api_keyThe
  3. If necessary, replace SELENIUM_PROMPT in background.js with the prompt template you want.
  4. Open Chrome and navigate to chrome://extensions/The
  5. Enable "Developer Mode" in the upper right corner.
  6. Click on "Load Extended Extensions" and select the extension directory.

Usage Process

  1. Click the AutoMouser icon in the Chrome toolbar to start recording.
  2. Perform the actions you want to automate.
  3. Click the icon again to stop recording and generate code.
  4. Two files will be downloaded:
    • tracking_log.json: Raw interaction data
    • selenium_test.py: Generated Selenium test scripts

Run the generated Selenium code

  1. Examine and run the generated Selenium code in your Python environment.
  2. Make sure you have the necessary Python packages installed, such as selenium cap (a poem) openaiThe

May not be reproduced without permission:Chief AI Sharing Circle " AutoMouser: Generating Browser Automation Code to Convert Mouse Actions to Selenium Python Scripts via AI

Chief AI Sharing Circle

Chief AI Sharing Circle specializes in AI learning, providing comprehensive AI learning content, AI tools and hands-on guidance. Our goal is to help users master AI technology and explore the unlimited potential of AI together through high-quality content and practical experience sharing. Whether you are an AI beginner or a senior expert, this is the ideal place for you to gain knowledge, improve your skills and realize innovation.

Contact Us
en_USEnglish