Record and Replay – Tutorial

Applies to CrossBrowserTesting SaaS, last modified on March 31, 2021

This tutorial describes how to record and run scripts. A script is a sequence of user actions on the tested web pages. You can run them later to check if the tested web app works as expected.

Tutorial steps

1. Start recording

  1. Select Record & Replay > Record a Script on the left.

  2. Enter the URL of the page to be tested.

  3. Select the desired screen resolution.

  4. Click Record Script:

    Start the recording

    Click the image to enlarge it.

    This will launch the recorder.

2. Record user actions

Recorder screen

Here is a sample view of the recorder screen:

Test editor overview

Click the image to enlarge it.

For more details on the recorder user interface, see Recorder UI Overview.

To record a script, …

… simply work with the page in the internal browser as a normal visitor would do this: click links and buttons, input text, scroll the page contents, and so on. The recorder will register all your actions as events.

A step is a series of events on the same web page. When you navigate to another page on the tested website, the recorder automatically starts a new step. If needed, you can also start a new step manually or group the recorded actions into a new step.

For information on recorded events and their parameters, see Recorded Events.

The maximum recording time is 30 minutes.

Additional operations during recording

  • Create a new step manually.
  • Add a validation (also called checkpoint or expect).
  • Record hover events.
  • Navigate to a new page by typing its URL at the top of the internal browser.
Stop recording

One web test typically corresponds to one user scenario. Once you’ve recorded all events that make up that scenario, you can stop recording:

The 'Stop recording' button

3. Play back the recorded script & save it

Note: For test automation, it’s very important that the recoded test works correctly. We highly recommend that you play back the recorded events to ensure the test works as expected:

Play back recorded test

If the test doesn’t work, fix it: check and change event properties, record additional events, delete and re-record certain test parts, or re-record the entire test.

If the test works as expected, you can save it. To do this, click Save Script in the message box that the recorder shows after successful playback, or select File > Save, enter the test name and optional description in the subsequent dialog and click Save:

Save recorded test

You can close the test recorder now.

If you exit the recorder without selecting the “Save” command, the recorded events will be lost.

4. Create and configure a suite

To run a test on a regular basis, create a test suite and add the test to it:

  1. Select Record & Replay > Replay a Suite on the left. Click New Suite on the right and specify the suite name and optional description in the subsequent dialog:

    Create a test suite

    Click the image to enlarge it.

    Click Create.

  2. In the subsequent dialog, click the scripts to add to the suite and then click Add Scripts:

    Add scripts to a test suite

    Click the image to enlarge it.

    Notes:

    • You can add up to 10 scripts to a suite to test up to 10 different user scenarios during one run.

    • Scripts in the suite run in parallel. They are not synchronized.

    • You can add the same script to different suites.

  3. After you’ve added scripts, you need to specify environments (or configurations) for the run. An environment (or configuration) is a combination of the operating system, browser, and screen resolution. Scroll the suite screen down to the Suite Browser List section, select the needed values and click Add Config:

    Add configurations to a test suite

    Click the image to enlarge it.

    You need to add at least one configuration. Without configurations, the suite will not run.

    You can add up to 10 configurations to verify how the tested website works for clients using different systems. Every script in your test suite will run on every configuration you add.

    Note: If you select an operating system first, the Browser drop-down list will have only those browsers that can run on the selected OS. To view all the browsers, clear the OS box.
    Similarly, if you select a browser first, the Operating Systems list will have only the systems on which the selected browser can run. To view all the available systems, clear the Browser box.
  4. You can scroll the page down and schedule the suite runs, if needed. See Automated Test Scheduling for details:

    The Scheduling button

    Click the image to enlarge it.

    Scheduling is optional. You can always start a suite manually.

5. Run the test suite

On the Suite Settings screen, scroll the page up to the beginning and click Run Suite:

The Run Suite button

Click the image to enlarge it.

Another option is to select Record & Replay > Replay a Suite from the menu on the left, and click Run Suite for your suite:

The Run Suite button

Click the image to enlarge it.

You can also schedule suite runs.

A click on the Run Suite button opens the screen where you can see information on script execution. To monitor how this or that script runs, click Watch Run:

Running suite

Click the image to enlarge it.

After the run is over, you will see results:

Results of the suite run

Click the image to enlarge it.

Click View Details to view the results of an individual script.

Click Share to share the results via a public URL, email, Slack, or Jira. See Collaborating Integrations for details.

If needed, you can run a script out of any suite: select Record & Replay > Record a Script from the menu on the left, find your script on the page and click Replay:

Running a script out of a suite

Click the image to enlarge it.

Difference between script runs

In the UI, you can play a script from the recorder screen, from the Record & Replay screen, and as part of the suite. You run a script from the recorder screen to verify it works as expected. This option of execution has some differences from the others:

  • The script engine is slightly different, but produces very similar results.

  • No ability to choose an operating system or browser.

  • This playback’s results are not stored.

What’s next?

This tutorial is over. We recommend reading a bit more to learn how to get most out of your recorded tests:

Best Practices

Tips and tricks on test recording and playback.

Automated Test Scheduling

Running tests regularly at certain points in time will help you catch regression bugs as soon as they appear.

Using Databanks in Record and Replay

Create data-driven tests to check the tested pages on different input data.

See Also

Recorder UI Overview
FAQ

Highlight search results