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

WPF Tests in Test Studio

Test Studio recording feature supports WPF applications built with .Net 4.5+ or .Net Core 3.1 and above, and .Net 5. To be able to initiate recording session against specific application, you need to list its executable in the WPF test.

This article guides you through the WPF test configuration process.

Tip

Check this video tutorial for recording an end-to-end WPF test scenario.

Configure WPF Test to Record Specific Application

The configuration of the WPF test requires an executable file of a valid WPF app to be specified and, thus, used for recording and execution. When you open a WPF test in Test Studio, you can see the Configure button in the Test tools ribbon. Click the Configure button to open the WPF Config Wizard.

WPF Config Wizard

Tip

If you attempt to initiate a recording session in WPF test, before it is configured, the WPF Config Wizard pops up and lets you provide the necessary details.

Choose the Application to Automate

Test Studio provides few options to define the application to automate - you can browse to the folder, where the executable file is located; or if the application is started, you can directly select it from the list of active apps.

Specify path to WPF app

The WPF Application Path field allows you to drag and drop the application's shortcut icon into it, or click Browse and locate it manually in File Explorer.

Browse path to WPF app

The Active WPF Applications list displays all WPF apps currently running and detected by Test Studio. Click on the desired one and hit the Select Application button and this will populate automatically the path to the executable file in the WPF Application Path field.

Select running WPF app

Once an executable file is selected, the WPF Application Path and Current Path Expanded fields get populated accordingly. WPF Application Path supports environment tokens (i.e. %Program Files%\MyApp\App.exe) and when using such, the Current Path Expanded field displays the full path to the executable file.

Selected app and expanded path

Set Default WPF Application Path

The automation process requires multiple tests to be created for a single application. In such case configuring each created test will be a tedious task. Therefore Test Studio allows you to set a default WPF app path on project level and use this for all WPF tests. The option is available in Project Settings -> General and once a Default Path is set each new WPF test in the project will be configured to use it.

Use default path

Record Application Window State

For WPF tests you can choose whether to record the changes in the application window state - Minimize, Maximize, Restore and Close actions can be captured automatically in the recording process. If the recording scenarios require to interact with the window state, you can enable the checkbox under the Recording Options section in the Config Wizard.

record the changes in the application window state

Note

Recording the changes in the application window state is a setting on project level. So, if it is enabled for one test in the project, it will be also applied for all existing and newly created WPF tests in the project.

Finish WPF Test Configuration

Once you applied all necessary settings, you can confirm the configuration by pressing the OK button. Then, when you hit the Record button, the configured WPF application will be launched and the recorder will be attached to it, so you can proceed with recording the test scenario.

Tip

In any case, when you need to change the applied settings, hit the Configure button to access the wizard again.

See Also:

In this article