Browser Plugin Recording
The TrueAssert browser plugin allows you to create automated tests by simply recording your interactions with a website. This is the fastest and most intuitive way to create tests.
Overview
When you record actions using the browser plugin:
Your clicks, form inputs, and navigation are automatically captured
XPath selectors are generated automatically for each element
The test is created with status REVIEW (ready for review and execution)
All steps are saved to TrueAssert immediately
Prerequisites
Before recording, ensure you have:
✅ Browser plugin installed (Installation Guide)
✅ Plugin authenticated with API key
✅ Target website open in a browser tab
Recording Workflow
Step 1: Open the Plugin
Click the TrueAssert extension icon in your Chrome toolbar
The plugin popup will open
If not authenticated, you'll see the "Connect to your account" screen
Step 2: Start Recording
Once authenticated, you'll see the "Ready to Record" state with a large "Record" button
Navigate to the website you want to test (if not already there)
Click the "Record" button in the plugin popup
A red recording indicator will appear on the webpage
The plugin state changes to "Recording..." with a live step counter
Step 3: Perform Actions
Simply use the website as you normally would:
Click buttons - Automatically recorded as CLICK actions
Fill form fields - Automatically recorded as FILL actions with values
Navigate between pages - Automatically recorded as GOTO actions
Submit forms - Automatically recorded
What Gets Captured:
Action type (CLICK, FILL, GOTO, WAIT)
XPath selector (automatically generated)
Value (for form inputs)
Description (auto-generated based on action)
Real-time Feedback:
Step count updates in the extension badge (e.g., "12" in red)
Step count displays in the plugin popup
Visual recording indicator on the page
Step 4: Stop Recording
You have two options:
Option A: Stop and Save Immediately
Click "Stop and Save" button
Test is saved immediately with a default name
You're taken to the "Test Saved!" state
Option B: Stop and Review
Click "Stop" button
Recording pauses but data is retained
You can review steps before saving
Click "Save" to save, or "Erase" to discard
Step 5: Save Your Test
Enter a test name (e.g., "Login Flow Test")
Click "Save" to create the test in TrueAssert
The test is created with status REVIEW
Click "View Test" to open the test in your TrueAssert dashboard
How Recording Works
Content Script Injection
When you start recording:
The plugin injects a content script into the active tab
The content script listens for DOM events:
clickevents → CLICK actionskeyupandinputevents → FILL actionssubmitevents → Form submissions
Each event is captured and sent to the service worker
XPath Selector Generation
For each captured action, the plugin automatically generates an XPath selector:
Selector Algorithm: Uses the robust XPath generation algorithm from
selector.jsPriority System:
ID selectors (penalty: 0) - Best
data-testid (penalty: 1)
ARIA attributes (penalty: 5)
Form attributes (penalty: 10)
Text content (penalty: 20)
CSS classes (penalty: 50)
Structural positioning (penalty: 1000+) - Last resort
Uniqueness Verification: Ensures selector matches exactly one element
Alternative Selectors: Multiple selector options may be generated
Step Creation
Each recorded action becomes a TestStep with:
Order: Sequential number (0, 1, 2, ...)
Action Type: CLICK, FILL, GOTO, WAIT
Selector: XPath expression (e.g.,
//button[@id='submit'])Selector Type: XPATH (default) or CSS
Value: Input value (for FILL actions)
Description: Human-readable description (auto-generated)
Test Creation
When you save the recording:
Plugin sends data to TrueAssert via Connect-ES (
CreateTestFromRecordingRPC)Backend validates API key and gets organization/project
Test is created with:
Name: Your provided name or auto-generated
Status: REVIEW (ready for review)
Target URL: Starting URL from recording
Project: First project in your organization
All steps are created and linked to the test
Test version is set to 1
Plugin States
The plugin has several states you'll encounter:
1. Authentication State (auth-state)
auth-state)When: Plugin not connected to TrueAssert
Action: Enter API key and click "Connect"
Next: Ready to Record state
2. Ready to Record State (ready-state)
ready-state)When: Authenticated and not recording
Action: Click "Record" to start
Features: Shows organization name, project info
3. Recording State (recording-state)
recording-state)When: Actively recording actions
Features:
Live step counter
"Stop and Save" button
"Stop" button
Red recording indicator on page
4. Stopped State (stopped-state)
stopped-state)When: Recording paused but not saved
Actions:
"Save" - Save the test
"Erase" - Discard recording and start over
5. Saved State (saved-state)
saved-state)When: Test successfully saved
Action: "View Test" - Opens test in TrueAssert dashboard
6. Settings State (settings-state)
settings-state)When: Accessing plugin settings
Features:
View/update API key
Configure server host (for local development)
Advanced Features
Session Capture
The plugin can capture browser session data (cookies, localStorage, sessionStorage):
Click "Session" button in ready state
Plugin captures current session data
Click "Save Session" to send to TrueAssert
Session data is stored for the project's domain
Element Selector
Get XPath selector for any element:
Click "Selector" button in ready state
Click any element on the page
XPath selector is generated and displayed
Click "Copy" to copy selector to clipboard
Best Practices
Recording Tips
Start on the Target Page: Navigate to your starting page before clicking Record
Use Clear Actions: Click buttons directly, don't rely on keyboard shortcuts
Complete Flows: Record complete user flows, not partial actions
Test Immediately: After saving, review and run the test to verify it works
Selector Quality
Prefer Stable Elements: Elements with IDs or data-testid attributes produce better selectors
Avoid Dynamic Content: Elements with frequently changing classes may produce brittle selectors
Review Generated Selectors: Check the test detail page to see generated XPath selectors
Common Issues
Recording Not Starting:
Ensure you're on a valid webpage (not chrome:// or extension pages)
Check that content script is loaded (refresh the page)
Verify plugin is authenticated
Steps Not Captured:
Some JavaScript frameworks may prevent event capture
Try clicking elements directly instead of using keyboard
Check browser console for errors
Selectors Not Working:
Review generated selectors in test detail page
Use alternative selectors if available
Manually edit selectors if needed
What Happens After Recording
Test Created: Test appears in your TrueAssert dashboard with REVIEW status
Steps Ready: All recorded steps are visible and editable
Ready to Execute: Test can be run immediately (no AI generation needed)
Can Be Edited: Steps can be modified, added, or deleted manually
Related Topics
Installation Guide - Set up the plugin
Your First Test - Quick start tutorial
Understanding XPath Selectors - How selectors work
Running Tests - Execute your recorded tests
Manual Test Creation - Edit recorded tests
Last updated