UI Action Recorder
Its a lightweight Chrome extension that enables users to seamlessly record, replay, and export their interactions on any webpage. Designed for automation testers and developers, it captures actions like clicks, inputs, and form submissions with visual feedback, and converts them into executable Selenium scripts in Python or Java. The extension features smart selector generation, visual indicators during playback, customizable playback speed, and an intuitive popup UI. Developed entirely in vanilla JavaScript with Chrome Extension APIs, this tool is ideal for fast prototyping, test script generation, and enhancing UI automation workflows.
🧩 High-Level Flow:
-
The extension has a popup interface with four main controls:
-
Record
: Starts capturing user interactions on the current tab. -
Play
: Replays the last recorded session. -
Export
: Generates Selenium code in either Python or Java. -
Clear
: Wipes all recordings.
-
-
Internally, the extension is divided into:
-
popup.js: Handles the UI and interactions.
-
background.js: Manages the state, communication between scripts, and screenshots.
-
content.js: Injected into webpages to capture DOM interactions.
-
manifest.json: Defines permissions and extension metadata.
- Records user interactions (clicks, inputs, form submissions, etc.)
- Visualizes elements during recording and playback
- Captures screenshots of actions
- Provides a simple interface for recording and replaying
- Shows visual indicators during recording and playback
- Adjustable playback speeds (Slow, Normal, Fast, Turbo)
- Export recordings to Python or Java Selenium scripts
- Clone or download this repository
- Open Chrome and navigate to
chrome://extensions/
- Enable "Developer mode" using the toggle in the top-right corner
- Click "Load unpacked" and select the directory containing this extension
- The UI Action Recorder extension should now appear in your extensions list
- Navigate to the web page you want to record actions on
- Click the UI Action Recorder extension icon in your browser toolbar
- Click the "Record" button to start recording
- Perform the actions you want to record on the web page
- Elements will be highlighted as you interact with them
- A red indicator will appear in the top-right corner during recording
- Click the "Stop" button in the extension popup when finished
- Navigate to the web page where you want to replay actions
- Click the UI Action Recorder extension icon
- Select a playback speed (Slow, Normal, Fast, or Turbo)
- Click the "Play" button to replay the most recent recording
- A blue indicator will appear in the top-right corner during replay
- Elements will be highlighted during replay
- The extension popup shows a list of your recordings
- Each recording includes a snapshot of the actions and a screenshot
- Click the "Clear" button to remove all recordings
- Click the "Export" button either in the main toolbar or next to a specific recording
- Choose the format (Python or Java)
- Review the generated code
- Click "Copy to Clipboard" to copy the code
- Use the code in your automation projects
The extension consists of the following components:
manifest.json
: Extension configurationpopup.html
&popup.js
: User interfacebackground.js
: Background service workercontent.js
: Content script that runs on web pages
- Complex interactions with shadow DOM elements may not be captured correctly
- Some dynamic websites might change their structure between recording and playback
- Elements that change or disappear might cause replay failures
- Generated Selenium code may need adjustments for complex scenarios
Comments
Post a Comment