New to Telerik Test Studio? Download free 30-day trial

How to Record Test

The Test Recording is one of the leading Test Studio features, which automatically captures your actions against the application under test. While recording, you can also add various verification steps to ensure the page state. A key benefit to mention are the built-in translators for all Telerik components, which allow you to automate specific actions and verifications for the controls. And all these are part of the recording flow without the need of a single line of code.

The below article will guide you trough the recoding process for web and WPF tests and how to get the most out of it.

  1. How to Start a Recording Session
  2. How to Add Steps in the Test
  3. Example of a Web Test Recording
  4. Example of a WPF Test Recording
  5. Stop the Recording Session
  6. Attach the Recorder to a Running Application
  7. What is the Compact Recorder

Start a Recording Session

When a web or WPF test is opened and active in the Test Studio project, the toolbar ribbon is switched to the Test tab. It provides useful options to control the recording and execution process of a test in Test Studio.

Test Ribbon Toolbar

Among all available buttons you can see the Record one at the first position. You can start a recording session with a single click on this button.

Test Studio

Tip

The recording session can be started with a keyboard shortcut Ctrl+R, or by using the Project Explorer context menu option Record.

How to Add Steps in the Test

Web Test Recording

When starting a recording session in the context of a web test you need to enter the URL of the page to automate and choose a browser to load the application in. The Recording dialog, which appears allows you to define these parameters.

Enter URL, Choose browser

Tip

If you plan to use a specific browser for the automation project, you can select that browser and enable the checkbox to 'Save my choice for the future' - this will set the browser as a preferred for this project and you will no longer be prompted to select a browser for recording.

To launch the selected browser and navigate to the listed URL, click the Record button in the Recoding dialog. This will start a new instance of the browser and will launch the Test Studio extension, if applicable, Then the target page will be loaded and the Compact Recording Toolbar will appear on top of the browser.

Attached recorder

The Test Studio UI remains in the background of the browser, but once the page is loaded and the Compact Recorder is attached, you can switch back to the project and check that a Navigate step is recorded using the same URL as defined when starting the recording session.

Recorded navigate step

Note

Once a recording session is started, do not start another instance of the same browser until the session is finished!

WPF Test Recording

The WPF application is a desktop app and thus the automation process slightly differs when it comes to recording a test in Test Studio - you need to define which is the application to test and where is its executable file - this is called configuration of the WPF test.

When you open a WPF test in the automation project, you can see that instead of the browser and web application control options in the toolbar ribbon, there is a Configure button, which gets you to the WPF Test Config dialog.

Configure WPF Test button

When the application details are configured, you can start recording the automation scenario against the WPF application. To start a recording session, use the Record button. This launches the executable file listed in the configuration process and attaches the Compact Recording Toolbar on top of the app.

Record WPF Test

Tip

The recording session for WPF test can also be started with a keyboard shortcut Ctrl+R, or by using the Project Explorer context menu option Record.

The Test Studio UI remains in the background of the application, but once you initiate any action against the application, this gets recorded in the test.

Recorded steps in WPF Test

Stop the Recording Session

The mechanism to terminate an active recording session is to completely close the automated browser or WPF application - this is how all processes and communication channels between the app and Test Studio gets dismissed.

Attach the Recorder to a Running Application (Applicable for IE or WPF Only)

In some occasions it is very useful to attach a recorder to the application, when it is in certain state, and then continue the recording process. The specifics of the recording process allow to attach a recorder and trigger a recording session to an already running application.

To trigger a recording session against an already started application, you need to use the dropdown under the Record button - in the list you can see all compatible processes, to which Test Studio recorder can be attached. Select one and wait for the __Compact Recorder to attach to the application.

Attach to running browser

Web Test - Internet Explorer only
Attach to running WPF instance

WPF Test - connect to running WPF application instance

Note

Attaching a recording session to an existing process is only applicable for Internet Explorer or WPF application. If you need to cover similar recording scenario for the other browsers (Chrome, Edge Chromium, Firefox), you can use the options for partial test execution.

What is the Compact Recorder

The Compact Recording Toolbar gets attached to the automated application for every recording session and it can be considered as the connection between the application under test and Test Studio.

To ease you in recording the test scenarios, the toolbar's size is minimal on top of the application window and you can change its position at any time. Through the Recording Toolbar you have access to helpful resources for the recording process - highlight and add elements to test project, explore the application under test's structure and its elements, add actions, verifications and common steps for your test scenario.

Compact recording toolbar

Below you can find a short description of each button in the toolbar (in the order these are listed) and reference for further details:

  • Enable/Disable hover over highlighting - used to highlight the elements that you hover over in order to access the Elements Menu pop-up with multiple options for the specific element.
  • Pause/Resume recording button - allows you to pause or resume the recording. When it is paused, your actions against the application under test will not be added to the test.
  • Show/Hide the Advanced Recording Tools in the Advanced Tools you have access to the application's DOM tree and various types of steps for the selected element.
  • Switch the orientation of the Compact Recording Toolbar between vertical and horizontal - this is additional feature to increase your productivity and allow you place the toolbar anywhere outside of the working area.

See also

In this article
Not finding the help you need? Improve this article