Verify that browser page was opened from WPF application

1 Answer 13 Views
WPF Testing
Garry
Top achievements
Rank 1
Garry asked on 25 Jun 2025, 07:37 PM

Is it possible to verify that a browser page was opened from a WPF desktop application automation?

We don't need to perform testing on the browser page, just the fact that the correct page was opened. May have to supply username/password during the process.

Thank you.

1 Answer, 1 is accepted

Sort by
0
Elena
Telerik team
answered on 27 Jun 2025, 10:16 AM

Hello Garry,

Test Studio tests target a specific application - in the case of Desktop and WPF tests you configure it, and for web tests you target a browser and use a URL to navigate to. Each type of test is scoped to the target application and cannot interact with any other embedded components - for example an embedded browser in a desktop/ WPF app, or any WinForms component implemented in a WPF app. 

Luckily we have the developed our Desktop Framework which allows you to setup more complex scenarios using all elements visible on the desktop. This framework can be used to tailor up these tests in code. Please, take the time to explore a demo of the Desktop capabilities in this article along with some examples to help in getting familiar with the topic in overall.

I hope this approach can fit your needs for validation. Thank you for your time in advance!

Regards,
Elena
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Garry
Top achievements
Rank 1
commented on 30 Jun 2025, 08:38 PM

Elena, thank you for answering my question. 

I was able to record a test using the Desktop framework, which worked for the WPF, but when it comes to the Web Browser, the desktop framework no longer works. Our WPF application opens the browser, so it's not an embedded browser or WebView. 

I also tried to record a simple Desktop Framework test opening either Edge or Chrome, both would open the browser, but then the recorder would not launch: "Unable to launch recorder..."

Here is the logs for both.

[06/30 14:52:17,Telerik.TestStudio.exe(125024:1),Uncategorized] Orchestrator._iUIProject_TestSelected() : Test 'DesktopTestWeb' selected.
[06/30 14:55:42,Telerik.TestStudio.exe(125024:18),Recording] RecordViewController.ApplicationLaunched() : Error launching the recorder. Error: Launched desktop application exited.
[06/30 15:09:54,Telerik.TestStudio.exe(125024:18),Recording] RecordViewController.ApplicationLaunched() : Error launching the recorder. Error: Launched desktop application exited.
[06/30 15:12:46,Telerik.TestStudio.exe(125024:18),Recording] RecordViewController.ApplicationLaunched() : Error launching the recorder. Error: Launched desktop application exited.
[06/30 15:26:06,Telerik.TestStudio.exe(125024:1),Uncategorized] Orchestrator._iUIProject_TestSelected() : Test 'DesktopTestChrome' selected.
[06/30 15:26:47,Telerik.TestStudio.exe(125024:18),Recording] RecordViewController.ApplicationLaunched() : Error launching the recorder. Error: Launched desktop application exited.
[06/30 15:29:03,Telerik.TestStudio.exe(125024:18),Recording] RecordViewController.ApplicationLaunched() : Error launching the recorder. Error: Launched desktop application exited.
Elena
Telerik team
commented on 02 Jul 2025, 11:41 AM

Hi Gary, 

Test Studio tests are scoped to the configured application - the specific selected WPF app for WPF tests, the specific configured desktop app for the Desktop type of tests, and the selected browser on launching web test. So, you cannot mix the applications recognized within a certain recording session as it depends on the type of test used. 

My initial suggestion, though, was to use the Desktop framework in a coded step - that way you can interact with all elements currently on the desktop from any type of test regardless from which application the elements are. 

So, if you take the time to review the demo article which shows the Desktop framework in action you see that all examples are listed in code and allows to interact with anything on the current desktop. The implementation which you can go for is as follows: 

  1. Use a WPF test type to record the scenarios for the WPF application under test.
  2. In the part of validating if a browser is opened use a coded step and perform the validation using the Desktop framework and its capabilities. 
  3. Then continue with the WPF part of the scenario in the standard test with recorded steps.

I hope this information clarifies the suggested solution. Let me know if you have further questions on the scenario. 

Regards,
Elena

Tags
WPF Testing
Asked by
Garry
Top achievements
Rank 1
Answers by
Elena
Telerik team
Share this question
or