This is a migrated thread and some comments may be shown as answers.

WPF + HTML pages (how to find Web elements in the same framework)

4 Answers 41 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Serhii
Top achievements
Rank 1
Serhii asked on 16 Mar 2020, 08:04 AM
Hi,

I try to use Testing Framework for WPF application.

But the problem is Login page in our application use HTML in WPF.

When I start WPF application from my code the login page is opening and I can find elements related only WPF elements .

But I can't find Web elements inside control WebBrowser, where located my fields Username and Pass and buttons.

System.NullReferenceException: 'Object reference not set to an instance of an object.'
ArtOfTest.WebAii.Core.Manager.ActiveBrowser.get returned null.



Please, could you tell me, is it possible to use testing framework with both functionalities - WPF + HTML?

If it is possible, can you provide an example of how I can find elements related WPF and HTML on the same Page.

4 Answers, 1 is accepted

Sort by
0
Elena
Telerik team
answered on 16 Mar 2020, 02:09 PM

Hello Serhil,

Thank you for the thorough description of the difficulties you have encountered, although I have to admit that the scenario you need to cover cannot be automated out of the box. This is because of the different mechanisms, which the Testing Framework uses to communicate with the browsers and the desktop WPF applications. 

Still, depending on the exact requirements you have, there may be a suitable workaround for this. I guess that the browser opens only for the login and if the scenario is that simple, you may try to handle it with the so called 'blind' keyboard actions. The solution should be similar to the one listed here for handling the Logon dialog here. The idea behind is to send the necessary keyboard key presses to enter the credential details and then press the Enter key to confirm. 

In case the above suggestion is not suitable for some reason, please, elaborate more on the particular requirements you need to cover and we can continue the discussion.

Thank you for your cooperation in advance.

Regards,
Elena
Progress Telerik

 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
 
0
Serhii
Top achievements
Rank 1
answered on 16 Mar 2020, 02:47 PM

Hi Elena,

I tried to handle your scenario and it works) and I can log in to the Application.

This case isn't suitable only in few cases, I can't work with Login Functionality and test it. 

But it isn't high priority tests, maybe I will find some workaround for that.

Thanks for the quick answer and example to handle my problem.  

 

0
Serhii
Top achievements
Rank 1
answered on 16 Mar 2020, 03:32 PM

I have one question can I use Testing Framework for free? 

Do I pay for it ?   isn't it trial version?

I'm just asking because maybe I miss something.

0
Elena
Telerik team
answered on 17 Mar 2020, 08:53 AM

Hi Serhil,

I am pleased to know that the proposed solution was helpful for you. 

Can you elaborate more on the scenarios where this so called 'blind' approach is not suitable? Basically, you can provide different credentials for login through the Keyboard manager TypeText() method.

In case you need further assistance, please, take the time to share details for the cases, which you have troubles with. 

Thank you for your cooperation once again.

Regards,
Elena
Progress Telerik

 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
 
Tags
General Discussions
Asked by
Serhii
Top achievements
Rank 1
Answers by
Elena
Telerik team
Serhii
Top achievements
Rank 1
Share this question
or