How to Use Selenium for Record and Playback
Tahera Alam
Posted On: April 16, 2025
274306 Views
12 Min Read
Selenium is a popular test automation framework that comes with a robust suite of tools, simplifying everything from writing test scripts to executing them.
You can also use Selenium for record and playback tests with one of its components, the Selenium IDE. With Selenium IDE, you can create automated tests without writing a single line of code.
TABLE OF CONTENTS
What Is Selenium IDE?
Selenium IDE is a browser extension that simplifies the process of creating automated tests for web applications. It allows you to record your actions on a website in the browser and playback those actions to verify the expected functionality.
It provides a user-friendly interface that allows you to quickly create and run test cases directly within your browser without requiring any technical expertise.
If you are new to Selenium, we recommend checking this guide on what is Selenium.
What Is Record and Playback in Selenium?
When it comes to codeless test automation, the record and playback feature in Selenium allows you to record your interactions with a website, and then you play them back to see if everything works as expected.
The record and playback feature is available within its ecosystem through the Selenium IDE. When you enable recording, the IDE captures every action you perform in the browser and translates it into a sequence of commands.
These commands are then saved as a test script, which can be executed later to replicate the same interactions. It also eliminates the need for repetitive manual testing and ensures consistency in test execution.

Run Selenium IDE tests across 5000+ real environments. Try LambdaTest Today!
How to Record and Playback With Selenium?
Now, let’s look at how to use Selenium for record and playback tests.
Install the Selenium IDE
Important: When writing this blog, the Selenium IDE extension is no longer available for the Chrome browser on the Chrome Web Store as it didn’t align with Chrome extension best practices.
You can still access the Selenium IDE extension on other browsers, such as Brave.
To demonstrate how to use Selenium for record and playback, we’ll use the Brave browser to run our tests.
- Install the Selenium IDE Chrome extension.
- Open the Selenium IDE and click on Create a new project.
- Give it a name and click OK.
Create a New Test
Now that we have a project ready, let’s create our first test in this project. For this purpose, we will use the LambdaTest eCommerce Playground website.
Currently, this is how our workspace looks like:
- Click on the Add new test button in the top left side and give the test a name:
- Click ADD and now we are ready to actually record the test and play it back.
Record the Test
Before you can start recording, you need to enter the URL of the website you want to test. To demonstrate this, we’ll use the LambdaTest eCommerce Playground. So, go ahead and paste this URL https://ecommerce-playground.lambdatest.io/ in the playback base URL field.
Once you enter the URL, click the recording button (at the top right in red). Selenium will open the website in a new tab and start recording all your interactions.
As you navigate through the website, Selenium records every action. This includes clicking buttons, filling out forms, selecting dropdown options, and navigating between web pages.
Now that recording is active, let’s follow the below steps will help you understand how Selenium IDE captures user interactions.
- Search for an iMac, check the results, and open a product page—Selenium IDE records each step.
- Click on the search bar, type “iMac,” and press Enter or click the search button.
- Click on any iMac product to open its details page—this click is also recorded.
- Once you have completed the actions, return to Selenium IDE and stop the recording.
The search results page appears, and Selenium IDE captures the navigation.
Now, let’s move on to the next step—playing back the test to see if it works as expected.
Playback the Test
Playing back a test in Selenium IDE allows you to automatically re-run the recorded steps and check whether the interactions you recorded work as intended.
Now, let’s see how we can playback the test we just recorded in the previous step.
Here, at the top of the Selenium IDE window, you can see a Run current test button. Click it, and Selenium IDE will automatically execute each recorded action step by step.
You can also run multiple tests in a sequence by clicking the right arrow next to each test. This will execute every test in your project one after another.
It becomes useful when verifying multiple workflows or features in a web application. Since our project has a single test, both buttons will have the same effect.
As the test runs, you’ll see the browser automatically repeat the recorded steps- navigating to the website, searching imac, viewing the results, and opening the product page just as you did while recording.
When this playback takes place, Selenium IDE offers feedback in real-time. If the test passes, all steps will run without errors. Selenium identifies a failed step and highlights it (for instance, if an element is not found or there are changes in the structure of the page). This makes it possible to quickly debug the test.
At the bottom of Selenium IDE’s window, you’ll see the test log showing the steps executed along with their timestamps and a message saying everything was executed successfully.
Now that we know how to record and playback a test, let’s explore how to export your test so it can be used in Selenium or other test automation frameworks.
Export a Test
Selenium IDE supports exporting tests in various programming languages and frameworks.
Let’s see how you can export your test:
- Click on the three dots menu located in the top left corner of the Selenium IDE window:
- Choose your preferred language/framework and other optional configurations, and click Export.
After selecting the format, simply save the file on your local machine and you are done.
The exported file will contain the test script in your chosen programming language. This script includes the commands and steps that Selenium IDE recorded.
You can now import this file into your development environment (e.g., Eclipse, IntelliJ IDEA, VS Code) and integrate it with your Selenium WebDriver project.
How to Run Selenium IDE Tests on the Cloud?
Up until now, we have learned how to record, playback, and export tests using the Selenium IDE. However, there are limitations to running tests on only your local browser. For instance, if you need to test on several browsers and operating systems to check how your website functions?
This is where cloud testing platforms like LambdaTest come into play. It is an AI-native test execution platform that enables you to execute Selenium IDE tests on a cloud-based grid.
LambdaTest provides you with access to various combinations of browsers and operating systems (Chrome, Firefox, Edge, Safari on Windows/macOS, etc.), which can help you run your tests in parallel, enabling faster software release cycles. Head over to this guide on running Selenium IDE tests on LambdaTest.
Now, let’s see how we can run the Selenium IDE tests on LambdaTest with just a few simple steps.
- Install Node.js.
- Connect Selenium IDE with LambdaTest. For that, you’ll need your Username and Access Key. To get the access, head over to your Account Settings > Password & Security.
- Install the Selenium IDE Runner (or the SIDE Runner) using the below given command:
- Open Selenium IDE and click on the save project icon to save it to your local machine.
- To direct your tests to the platform, you’ll need the LambdaTest Username and Access Key in the LambdaTest grid URL. In this URL, replace user-name and access-key with your actual LambdaTest credentials.
- Desired capabilities are a set of key-value pairs that let you define the specific environment for test execution.
- Open your terminal, navigate to the directory containing your .side file, and run the following command, replacing the user-name and access-key with your actual values:
1 |
npm install -g selenium-side-runner |
This will help you run the tests outside the browser.
In earlier sections, we already created a test in the Selenium IDE, so let’s just export it.
This file contains your recorded test case, which will be used to run tests on LambdaTest. You can also access the exported Selenium IDE project in this GitHub repository.
1 |
https://user-name:access-key@hub.lambdatest.com/wd/hub |
So, in this step, specify the browsers and operating systems you want to test against. You can also use LambdaTest Automation Capabilities Generator to simplify this process.
For instance, to test on Chrome with Windows 11, we will use the following configuration for Selenium 4:
1 2 3 |
options = ChromeOptions() options.browser_version = "latest" options.platform_name = "Windows 11" |
1 2 3 |
selenium-side-runner "your-test-file.side" --server https://user-name:access-key@hub.lambdatest.com/wd/hub -c " options = ChromeOptions() options.browser_version = "latest" options.platform_name = "Windows 11"" |
Ensure to replace your-test-file.side with the accurate file name of your Selenium IDE project.
With these steps, your Selenium IDE test is now running on the LambdaTest online Selenium Grid.
You can now check the test execution results directly from the LambdaTest Web Automation dashboard.
Best Practices to Use Selenium for Record and Playback
Record and playback is an easy way to automate tests without writing test scripts, but to make the most of this functionality, you’ll need to follow below best practices.
- Avoid using XPath whenever possible. It tends to break when a webpage’s structure changes. Instead, choose more reliable options like IDs, class names, or data attributes.
- Split your tests into smaller, reusable chunks. Instead of cramming multiple actions into a single test, create separate test cases for common tasks like logging in or form submissions.
- Web applications aren’t always static, so use control flow commands like if, while, and times to handle changing conditions. This helps make your tests more adaptable.
- Testing isn’t just about running actions—it’s about verifying results. Add assertions to check that the application behaves as expected at key points in your test.
- Automated tests often fail because they move too fast. Adding wait commands ensures the script pauses until elements are ready, preventing unnecessary failures.
- Recorded scripts aren’t perfect. Instead of relying on them as-is, take the time to refine them, adding logic to handle dynamic content and edge cases.
Conclusion
If you are just getting started with test automation, then there is nothing better than using Selenium IDE to record and playback tests. It lets you record and replay tests, which makes it ideal for accelerating repetitive tasks.
That said, the record and playback feature is not without its limitations. It is good for simple tests and relatively static websites but not ideal for complex workflows or dynamic elements that update often.
You’ve just learned the fundamentals; now let’s get into Selenium IDE and automate some web tests!
Happy testing!
Frequently Asked Questions (FAQs)
How do you record a Selenium session?
You can record a Selenium session using Selenium IDE, a browser extension that captures user interactions. It allows testers to record, edit, and replay test cases without coding. Alternatively, you can log browser interactions using WebDriver with tools like DevTools Protocol.
What is record and playback in testing?
Record and playback is a testing approach where user actions on the software application are recorded and then replayed to execute the same steps automatically. It’s commonly used for UI testing for quick test creation without writing code. This method helps testers validate functionality by mimicking user behavior.
Can Selenium Grid record and replay?
No, Selenium Grid itself does not support recording or playback of tests. It’s used for parallel and distributed test execution across multiple machines.
Can you record with Selenium?
Yes, but only with Selenium IDE, which allows recording user interactions with the browser. Selenium WebDriver and Selenium Grid don’t have built-in recording features—they rely on test scripts.
Citations
- Selenium IDE: https://www.selenium.dev/selenium-ide/
Got Questions? Drop them on LambdaTest Community. Visit now