How to Use Selenium for Record and Playback
Record browser actions with Selenium IDE, replay them, add checks for expected results, and learn when to move to WebDriver for maintainable tests.
Selenium’s record-and-playback tool is Selenium IDE, a browser extension for recording and replaying browser actions. Create a project, enter the application’s base URL, record a user journey, save the project as a .side file, and replay the test. Then add checks for expected results: a sequence of recorded clicks alone does not prove the application behaved correctly.
This guide covers a quick recorded test, how to make it more useful, what to do when it fails, and when to export or rewrite it as WebDriver code. Selenium’s documentation describes IDE for quick bug-reproduction scripts and automation-aided exploratory testing; WebDriver is the better fit for robust regression suites and scripts that need to run across environments. Selenium documentation
1. Install Selenium IDE and start a project
Selenium documents IDE as a browser extension and lists Google Chrome, Mozilla Firefox, and Microsoft Edge. Browser-store availability and the exact installation steps can change, so check the current Selenium IDE installation instructions for your browser before relying on an older tutorial’s screenshots.
- Install Selenium IDE from the browser’s extension store or the current Selenium IDE installation page.
- Open Selenium IDE and create a new project.
- Give the project a descriptive name, such as
checkout-smoke-test. - Enter the application’s base URL, for example
https://example.com. - Start recording. IDE opens a browser window at the configured URL.
Use a stable test or staging environment when possible. A recording against production can submit real forms, create real accounts, or change real data.
2. Record a user journey
- In the opened browser, carry out the journey you want to reproduce, such as opening a page, entering search text, submitting a form, and navigating to a result.
- Keep the journey focused. A short test with one clear outcome is easier to diagnose than a long recording that covers unrelated actions.
- Return to the IDE and stop recording with its recording control.
- Inspect the recorded command list. Remove accidental clicks or steps that are not part of the intended scenario.
A recording is a starting point, not a guarantee of a stable test. It captures interactions observed during that session; it may depend on page state, timing, test data, or element identification that changes later.
3. Save the project and organize tests
Save the project from Selenium IDE. The documented project format is a .side file. Keep it in version control alongside the application or test documentation so changes to the test can be reviewed. IDE also supports grouping tests into suites for playback as a group.
Give tests and suites names that describe the scenario and expected result, such as Search returns matching product. Avoid putting secrets or real customer data into a recorded project. If the scenario requires credentials, use a test account and follow your team’s secret-handling practices.
4. Replay the test and check its outcome
Select a test or suite in IDE and use the play control. Playback runs in a browser. Selenium’s getting-started guide says IDE reuses the existing recording window when it is open; otherwise it opens another window.
Watch the replay at least once and inspect the command results. A test that finishes without a command error may still have reached the wrong page or displayed the wrong content. Add explicit checks for the outcome that matters.
Use assertions and verifications
Selenium IDE’s command reference distinguishes hard assertions from soft verifications. An assert stops the test when its condition fails. A verify reports a failed check while allowing later commands to run. Choose based on whether continuing after that particular failure is useful.
| Check style | Use it when | Failure behavior |
|---|---|---|
assert |
The remaining steps depend on this condition being true, or the condition is the main pass/fail requirement. | Stops the test at the failed assertion. |
verify |
You want to report a problem and still collect results from later independent checks. | Records the failure and continues. |
For example, after submitting a search, add a check that the results heading or a known result is present. Choose a locator that identifies the intended element, and confirm the locator against the current page. The exact command and locator available depend on the page and the installed IDE version; consult the Selenium IDE command reference.
5. Improve a recording before depending on it
- Check the result, not only the action. Add assertions for the visible or navigational outcome that defines success.
- Keep test data predictable. Reuse a known test account or reset data between runs where the application requires it.
- Use focused scenarios. Separate unrelated workflows so one failure does not obscure another.
- Review selectors. If a test breaks after a layout change, inspect whether the recorded target still identifies the intended element.
- Replay after editing. A changed command can affect later steps; run the full test or suite after refining it.
- Keep environment assumptions visible. Record which base URL and test data are required so another developer can reproduce the run.
Recorded tests are most useful as quick reproductions, exploratory aids, and learning material. When a test becomes business-critical or needs broader control over setup, assertions, reuse, and execution, export it as a draft or move the scenario into a coded WebDriver suite.
6. Export toward WebDriver when the test needs code
Selenium IDE’s export documentation describes exporting a test or suite to WebDriver code. The listed targets include C# NUnit, Java JUnit, JavaScript Mocha, and Python pytest. Export availability can vary by IDE release, so check the current export interface and supported targets in the installed version.
- Select the test or suite you intend to export.
- Choose the export option in IDE and select a supported language and test framework.
- Save the generated code into the appropriate project and install its required dependencies using that project’s normal setup.
- Review the generated code. Treat it as a starting point: verify selectors, waits, test data, setup and cleanup, and assertions.
- Run it in the project’s target environment and make the result reproducible before relying on it in regression checks.
WebDriver is preferable when you need maintainable logic, shared setup, repeatable regression automation, or execution distributed across environments. Exporting does not automatically create a complete test architecture; generated code still needs review and maintenance. Selenium’s overview of IDE and WebDriver
7. Run recorded tests beyond the IDE
Selenium’s getting-started guide points to the command-line runner for running IDE tests with additional browsers. Runner compatibility and setup are version-sensitive, so use the current runner documentation for installation, browser support, and invocation rather than copying an unverified command from an older guide. The runner is not a prerequisite for recording and replaying a test in the IDE.
For cross-browser work, first confirm that the runner version, browser, and driver setup you plan to use are supported together. Keep the same test data and application environment across runs where possible; otherwise a browser difference can be confused with a data or environment difference.
Common problems and fixes
| Problem | Likely cause | What to do |
|---|---|---|
| IDE does not open or cannot be installed | The browser’s extension availability or installation flow has changed, or the browser is managed by an organization. | Check Selenium’s current IDE installation guidance and your browser’s extension policy. Do not assume old store screenshots match today’s flow. |
| Recording starts at the wrong page | The project base URL is incorrect or redirects to a different route. | Edit the project’s base URL and confirm the intended starting page before recording again. |
| A click or typing step fails on replay | The page changed, the recorded target no longer matches, or the page was not ready when the command ran. | Inspect the failing command and target in IDE, confirm the element on the current page, and adjust the step or timing using supported IDE commands. |
| The test replays but gives a false sense of success | The recording contains actions without checks for the expected application state. | Add an assertion for the key result, such as the expected page content or confirmation state. |
| Later commands do not run after a failed check | A hard assertion stopped playback. | Use a soft verification only when continuing to collect other independent results is appropriate; keep hard assertions for required conditions. |
| The exported test does not run | The selected export target, dependencies, runtime, or generated code do not match the current project setup. | Check the installed IDE’s export targets, install the framework dependencies, and review the generated code and project configuration. |
| A test passes locally but not in another environment | Browser, application data, URL, or environment assumptions differ. | Document the base URL and test data, verify browser and runner compatibility, and make setup repeatable before comparing results. |
Performance, reliability, and cost
Selenium IDE avoids writing code for an initial interaction recording, but it does not remove the work of reviewing selectors, adding meaningful checks, and maintaining the test as the application changes. Keep recordings short and focused to reduce the number of steps that can fail and make diagnosis easier.
Replay reliability depends on the application state and the recorded steps. Use a controlled environment and predictable data, inspect failures rather than simply re-recording, and move important regression coverage into WebDriver code when the workflow needs maintainable setup and repeatable execution. The research sources provide no supported adoption, reliability, time-saving, or cost benchmark for Selenium IDE, so no quantitative claim is appropriate here.
Selenium IDE is a free Selenium component; the main costs are the developer time needed to refine and maintain tests and any infrastructure used for broader execution. Cross-browser execution may require the current command-line runner and compatible browser setup.
Or skip the browser setup
Selenium IDE is for recording and replaying browser tests. If the task is to capture a webpage as an image or PDF, ScreenshotNeo provides a website screenshot API and MCP server. Its API accepts a URL in one GET request and can return PNG, JPEG, WebP, or PDF. See the ScreenshotNeo API documentation.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
import requests
r = requests.get(
"https://api.screenshotneo.com/v1/shot",
params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"},
timeout=90,
)
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
if (!res.ok) throw new Error(`Screenshot request failed: ${res.status}`);
await Bun.write('shot.webp', res);
- Cookie banners are accepted and removed before capture; ScreenshotNeo also removes known newsletter popups and chat widgets. Each of these steps can be turned off.
- Bot checks, blank pages, timeouts, failed loads, and cache hits cost nothing. The response includes
X-Page-VerdictandX-Billedheaders. - An MCP server provides
take_screenshot,get_page_info, andcapture_pdftools for Claude, Cursor, and other MCP clients. - The Free plan includes 1,000 shots per month with no card. Paid plans start at $5 for 3,000 shots; every feature is on every plan.
Create a free ScreenshotNeo account for 1,000 screenshots a month with no card.
FAQ
What file does Selenium IDE save?
The documented project format is a .side file. It can contain tests and suites for playback in IDE.
Does recording alone make a complete regression test?
No. Replay the steps, inspect them, and add checks for expected outcomes. Move to WebDriver when you need maintainable regression automation.
Can I use a recorded test in other browsers?
Selenium points to the command-line runner for additional-browser execution. Check the current runner documentation for exact compatibility and setup.
Can I export to Python or JavaScript?
The export documentation lists Python pytest and JavaScript Mocha, along with C# NUnit and Java JUnit. Available targets can depend on the installed IDE version.


