This guide shows you how to use the Chrome DevTools Recorder to record, replay, and automate user flows directly in your browser. You’ll learn to capture interactions, edit steps, and export tests for continuous integration—no extra software needed beyond Chrome.
What You’ll Need
- Google Chrome (version 89 or later; the Recorder is built into DevTools).
- A test website or web app you can interact with (local or live).
- Optional: Node.js if you want to run exported Puppeteer or Playwright scripts.
Step-by-Step
- Open DevTools. In Chrome, navigate to your target page. Right-click anywhere and select Inspect, or press Ctrl+Shift+I (Windows/Linux) or Cmd+Option+I (Mac).
- Open the Recorder panel. In DevTools, click the More tabs (>>) icon in the top menu bar, then select Recorder. If you don’t see it, click the three-dot menu (⋮) and choose More tools > Recorder.
- Start a new recording. In the Recorder panel, click Start recording (the red circle button). A small floating toolbar will appear at the bottom of the browser window.
- Perform the user flow. Interact with the page exactly as a user would: click buttons, fill forms, hover over menus, navigate to other pages, etc. The Recorder captures each action in real time.
- Stop recording. When you’ve completed the flow, click the red Stop recording button in the floating toolbar. The recording is saved as a new user flow in the Recorder panel.
- Review the steps. In the Recorder panel, you’ll see a list of steps (e.g., “Click”, “Type”, “Navigate”). Click on any step to see details like the selector used. You can reorder steps by dragging them, or delete unwanted ones.
- Edit a step (optional). To change a step, click the pencil icon. For a “Type” step, you can modify the text entered. For a “Click”, you can change the selector. Use the Selector field to specify a more robust CSS selector if needed.
- Replay the recording. Click the Replay button (the play icon) to run the flow again. Chrome will execute the steps and show a result summary. If a step fails, it will highlight where the problem occurred.
- Export the recording. Click the three-dot menu next to the recording name, then select Export. Choose a format: Puppeteer, Playwright, or JSON. This downloads a script file.
- Run the exported script (optional). If you exported a Puppeteer or Playwright script, you can run it in a Node.js environment. Install the respective library (
npm install puppeteerornpm install playwright), then run the script withnode script.js.
Common Mistakes
- Using fragile selectors. The Recorder often picks auto-generated selectors like
#main-content > div:nth-child(2). These break if the page layout changes. Prefer adding stable attributes (likedata-testid) to your elements, or edit the step’s selector to use a unique ID or class. - Recording too much. Including mouse movements, hover states, or scrolls that aren’t essential can make the replay flaky. Keep the flow minimal—only the necessary interactions.
- Not waiting for elements. The Recorder doesn’t automatically add waits. If your page loads slowly or uses animations, the replay might click before an element is ready. Add explicit wait steps or use the Wait for element option (available in some versions) to improve reliability.
- Ignoring dynamic data. If your flow involves entering a unique value (like an email), replaying the same script will fail if that value already exists. Use variables or randomized data in your exported script.
- Forgetting to clear storage. If your app relies on localStorage or cookies, a previous session might affect the replay. Clear site data before recording a clean flow.
Tips
- Use the “Assert” feature. In the Recorder, you can add assertions to verify that an element is visible or contains specific text. This turns a simple replay into a real test that checks expected behavior.
- Name your recording clearly. Use descriptive names like “Checkout Flow” or “Login Error” so you can identify them later.
- Organize recordings into folders. In the Recorder panel, you can create folders to group related flows—useful for larger projects.
- Leverage the “Performance” tab. While replaying, open the Performance panel to record metrics. This helps you spot slow steps that could be optimized.
- Combine with CI. Export your flows as Puppeteer or Playwright scripts and integrate them into your continuous integration pipeline to catch regressions automatically.
- Keep selectors simple. Whenever possible, use IDs or data attributes that are unlikely to change. This reduces maintenance when your app evolves.
Troubleshooting
- Replay fails with “Element not found”. This usually means the selector is outdated. Open the step, copy the selector, and test it in the Console using
document.querySelector('your-selector'). If it returns null, update the selector to a valid one. - Replay is too fast/slow. The Recorder doesn’t simulate human timing. If your app needs time to load, add explicit wait steps (right-click on a step > Add step > Wait). Alternatively, in the exported script, add
await page.waitForTimeout(1000)or similar. - Export script won’t run. Ensure you have the correct Node.js version and the required library installed. For Puppeteer, also check that the browser path is correct—sometimes you need to specify
executablePathin the launch options. - Recording doesn’t capture a specific action. Some actions like file uploads or drag-and-drop may not be recorded properly. In such cases, manually add the step in the Recorder or handle it in the exported script.
- The Recorder panel is missing. If you don’t see the Recorder, update Chrome to the latest version. It’s also possible the panel is hidden; click the Customize and control DevTools (⋮) > More tools > Recorder.
Frequently Asked Questions
Can I record flows on any website? Yes, as long as you can open it in Chrome. However, if the site restricts automation (like some banking sites), the replay might be blocked.
Do I need to know how to code? No. The Recorder is visual and requires no coding. However, editing exported scripts or adding complex assertions will require some JavaScript knowledge.
Can I use the Recorder for testing on mobile devices? The Recorder works with the desktop browser. To test mobile, you can use Chrome’s device emulation mode, but the recorded steps may not perfectly replicate touch events.
Is the Recorder free? Yes, it’s built into Chrome and completely free. No separate license or account is needed.
What’s the difference between Puppeteer and Playwright exports? Both are Node.js libraries for browser automation. Puppeteer is developed by Google, while Playwright is from Microsoft. They have similar APIs, but Playwright supports multiple browsers (Firefox, Safari) out of the box.
Can I use the Recorder to generate a test for a specific framework like Cypress? Not directly. You’d need to convert the JSON export manually or use a third-party tool. The built-in exports are only Puppeteer, Playwright, and JSON.
Related
General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.
More in this bed
- iOS 18 Safari Not Working? Fixes That Help
- How to Check Your Linux Kernel for Spectre
- iPhone Safe Mode: How to Enable or Disable It
- Fix Slow Internet Lag on Samsung Galaxy Note
- How to Get iOS 17 on iPhone X (Safe Methods)
- Fix Gmail IMAP Error in Outlook: Step-by-Step