# WPF Tests in Test Studio

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

This article guides you through the WPF test configuration process.

* [Configure WPF Test to Automate Specific App](https://www.telerik.com/teststudio/documentation/automated-tests/wpf/wpf-test#configure-wpf-test-to-record-specific-application)
* [Choose the Application to Automate](https://www.telerik.com/teststudio/documentation/automated-tests/wpf/wpf-test#choose-the-application-to-automate)
* [Record Application Window State](https://www.telerik.com/teststudio/documentation/automated-tests/wpf/wpf-test#record-application-window-state)
* [Finish WPF Test Configuration](https://www.telerik.com/teststudio/documentation/automated-tests/wpf/wpf-test#finish-wpf-test-configuration)

> **Tip**
> <br>
> <br>
> Check <a href="https://www.telerik.com/videos/teststudio/test-recorder-for-wpf-video-tutorial-test-studio" target="_blank">this video tutorial for recording an end-to-end WPF test scenario</a>.

## 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](https://www.telerik.com/teststudio/documentation/assets/ab51bbcb15dc404d43bbb04511afc5ac/fig1.png)

> **Tip**
> <br>
> <br>
> 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 different options to define the application to automate:

* [Specify an executable file](https://www.telerik.com/teststudio/documentation/automated-tests/wpf/wpf-test#configure-application-path-in-wpf-test);
* [Use a default path](https://www.telerik.com/teststudio/documentation/automated-tests/wpf/wpf-test#set-default-wpf-application-path);
* [Select application from the list of active apps](https://www.telerik.com/teststudio/documentation/automated-tests/wpf/wpf-test#select-running-wpf-application);
* [Define startup arguments and working directory](https://www.telerik.com/teststudio/documentation/automated-tests/wpf/wpf-test#startup-arguments-and-working-folder-for-wpf-application)

![Specify path to WPF app](https://www.telerik.com/teststudio/documentation/assets/085749d318de87ac4f45b59104f89879/fig2.png)

## Configure Application Path in WPF Test

The **WPF Application Path** field accepts drag and drop of the application's shortcut icon; Or use the **Browse** button to locate the executable file manually in a File Explorer.

![Browse path to WPF app](https://www.telerik.com/teststudio/documentation/assets/c17c042d37cb223b8a9b489c4f33d4ab/fig3.png)

**WPF Application Path** field supports using environment tokens (such as `%Program Files%\MyApp\App.exe`). When using environment tokens, the **Current Path Expanded** field displays the full path to the executable file.

![Selected app and expanded path](https://www.telerik.com/teststudio/documentation/assets/afaf44fc91e1c01c9c463545c1d49c09/fig5.png)

## 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. The solution offered by Test Studio is to **set a default WPF app path on project level** and use this for all WPF tests.

The option is available in <a href="/features/project-settings/general" target="_blank">Project Settings -> General</a> and once a **Default Path is set** each new WPF test in the project is configured to use it.

![Use default path](https://www.telerik.com/teststudio/documentation/assets/d0b2c5482fd3b497ac9083322ff10c55/fig6.png)

## Select Running WPF Application

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

![Select running WPF app](https://www.telerik.com/teststudio/documentation/assets/94dee47e8316e63666d4b70e1d897584/fig4.png)

## Startup Arguments and Working Folder for WPF Application

The configuration of a WPF application lets you set startup **Arguments** and a **Working folder** if these are required for the proper functioning of the tested WPF app.

![Arguments and Working folder](https://www.telerik.com/teststudio/documentation/assets/6696f9ae4aad69f41107829d1ecf2889/fig5a.png)

## Record Application Window State

Test Studio lets you record the changes in the application window state - **Minimize, Maximize, Restore** and **Close** actions can be captured automatically while in the recording process. If the automation scenarios require to interact with the window state, enable the checkbox under the **Recording Options** section in the **Config Wizard**.

![record the changes in the application window state](https://www.telerik.com/teststudio/documentation/assets/f05c000bdb2e953c0d3e2c43cba94478/fig7.png)

> **Note**
> <br>
> <br>
> **Recording the changes in the application window state is a setting on project level**. So, once you enable it for one WPF test in the project, it is applied for all existing and newly created WPF tests in the current project.

## Finish WPF Test Configuration

Once you applied all necessary settings, **confirm the configuration** by pressing the **OK** button. Then, when you hit the <a href="/automated-tests/recording/overview#start-a-recording-session" target="_blank">**Record** button</a>, the configured WPF application is launched and the Test Studio recorder gets attached to it, so you can proceed with recording the test scenario.

> **Tip**
> <br>
> <br>
> In any case, when you need to change the applied settings, hit the **Configure** button to access the wizard again.

## See Also:

* <a href="https://www.telerik.com/videos/teststudio/test-recorder-for-wpf-video-tutorial-test-studio" target="_blank">WPF Test Recording Video Tutorial</a>.
