Record and Playback Testing in 2020: It’s Come a Long Way

Automated testing makes the whole testing process easy and fast. Record and playback testing make that process easier and quicker.…

Testim
By Testim,

Automated testing makes the whole testing process easy and fast. Record and playback testing make that process easier and quicker. Record and playback testing has been around for quite some time, but it’s delivering more value these days. But it’s been a roller coaster ride.

In this post, I’ll be talking about what record and playback testing is and why it developed a bad reputation. We will then discuss some of the improvements that make record/playback worth another look.

What Is Record and Playback Testing?

Record and playback testing is a type of automated testing where the tool records the activity of the user and then imitates it. Let’s say you want to test a website using record and playback testing. You would start a recording with your tool and then walk through a user journey manually. The tool will record your actions and save them in a repeatable test.

Replaying the user scenario will cause the tool to repeat your actions from the recording and run the test on the application. Some tools also generate logs of the application’s behavior when a specific action is performed.

Now that you know what record and playback testing is, let me tell you how it’s different from scripted automated testing.

Record and Playback Testing vs. Scripted Testing

Scripted testing is when you code or script your tests using an automation framework designed to test the application.

The main requirement with scripted testing is that you need to know how to code. The depth of coding knowledge required depends on the complexity of the application and the framework. If you’re testing a simple web page, basic understanding of JavaScript may be enough. But if you’re testing a complex application, you’ll need to know more about specific modules. Also, you’ll also have to understand the specific syntax of the testing framework (e.g., Selenium, Puppeteer*, Appium) you are using to structure the tests properly.

* Note: We released a free recorder for Puppeteer that makes this a little easier. Use it as often as you like.

You don’t need any coding knowledge for record and playback testing. You only need to know how to structure your user flows to test the application. The tool will convert user journeys into tests automatically. This makes recording a test very fast and minimizes the skills required.

For skilled coders, modifying and updating a scripted test can be easier than fixing a recorded test. Suppose you’ve written a script to test five different components of the application. If you need to change a part of the test that exists in multiple components, you can use your IDE to search and replace, or to create a method to make the test more efficient. Reusing parts of your test can often be easier when done in code than in recorded tests.

Early record and playback tools, didn’t allow for partial updates. If you changed even a single component of the application, it required a completely new test recording. Modern record/playback tools have fixed this limitation.

Why Did Record and Playback Testing Get a Bad Reputation?

Early record and playback testing tools lacked the flexibility needed to handle many web applications. They didn’t allow for editing of the recorded test and lacked key features like assertions. They also didn’t cover all of the web user actions that are possible. Actions like drag-and-drop, hover, and menu selection often caused errors.

  • Maintenance – When you recorded a test and played it back, it would be fine as long as the application remained exactly as when the test was recorded. Even minor changes in the application made the recording invalid, requiring that the test be rerecorded.
  • Limited Functionality – People thought that record and playback testing was only a navigation testing tool. The tools didn’t help validate that functionality was properly executed, only that a user could click through steps.
  • Poor Integration – Earlier record and playback testing tools didn’t provide easy integration into other tools used in the development process. Tests ran manually, and results were in a separate tool requiring context switching.
  • Troubleshooting – Once a test played, if it failed, there was little information to help QA determine why it failed. Was it poorly written? Did it fail because of an element loaded slowly? Or was there actually a bug in the application?

Perhaps some of the reason that record/playback tools received a bad reputation is that bad news travels faster than good news. Bad experiences are remembered, influencing opinions for years. Even when modern tools fix these limitations many people need first-hand proof to change.  So let’s see how modern record and playback testing has changed.

How Record And Playback Testing Has Evolved

I’m going to use Testim as an example of how record/playback has evolved and made testing easier and faster. These are a few of the advantages of using modern record and playback testing tools.

  • Accurate Rendering – Automated testing tools these days are smarter than earlier ones. The recording tools accurately convert UI actions like menu selection, drag-and-drop, and hovers into test steps. Fewer actions are missed.
  • Easier Editing – Recorded tests are no longer a single, unchangeable monolith. Today’s recordings split into discrete steps that can be deleted, rearranged, or grouped. Additional steps can be added and configured to improve the test quality.
  • Integration Is Now Possible – You can now integrate your tests into tools used in your development pipelines. Tests can be synchronized with your version control system (like GitHub) so that tests branches mirror code branches. Tests can be easily integrated into CI tools to run on builds, pull-requests or scheduled intervals. Results can be integrated into collaboration tools like Slack to show when builds and their tests passed or failed. And even bugs can be created right from the test automation tool and submitted into a bug tracking tool. All of these integrations help teams stay in their workflows to accelerate releases.
  • Advanced (script-like) Testing Features – There are a few features of programming such as loops, conditions, and local debugging that can improve test efficiency. These features are built as settings that can be configured without coding. Additional features such as email and PDF validation, multi-tabs/windows and even custom JavaScript insertion provide all the flexibility you need.
  • Self-Healing Tests – Modern record and playback testing tools leverage artificial intelligence (AI) to identify elements in the web application better so that tests don’t fail. They also can wait for elements to appear before executing a test step to prevent unnecessary test failures.
  • Troubleshooting – Tests will fail. When they do, you need a quick way to identify the failure and make corrections. Some of today’s codeless test automation tools simplify this process with step failure indicators, comparison screenshots, even console logs, and network information. Reporting can also help identify duplicate errors or recurring problems.
  • Test Results The most valuable outcome of testing is the results. Results are what help you understand what’s wrong and how to fix it. Modern testing tools provide various features for result handling such as result retention, error aggregation, storing console logs, etc. This quickens the process of result storage and makes it easy for result analysis.
  • Bug Reporting – Modern testing tools don’t just generate results, but they also help report bugs in more illustrative ways. Screen capture, video and test steps to recreate the bug all help communicate where exactly the bug is present.

It’s Come a Long Way

Though record and playback testing had a few hurdles early on, these tools have evolved into a better and smarter way for testing applications. Recording can save you a lot of time creating tests which helps to accelerate your software development releases. It also helps to build out the test coverage needed to test your applications fully. To see how Testim’s test automation tool can benefit your business, get it free.