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

Not able to verify wpf window is loaded

3 Answers 78 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
rashmi
Top achievements
Rank 1
rashmi asked on 25 Apr 2016, 05:47 AM

Hi team,

We are doing POC for one of our wpf application.

Can you please give me the method or properties  which verify wpf window is loaded or not and should return true /false.

 

Thank you,

3 Answers, 1 is accepted

Sort by
0
Nikolay Petrov
Telerik team
answered on 26 Apr 2016, 03:35 PM
Hello Rashmi,

The method you may use is WaitForWindow(). You have to create coded step using following line to verify if the next window is loaded:

Assert.IsNotNull(ActiveApplication.WaitForWindow("your next window name"));

You can read more about it on our public API Reference here.

Regards,
Nikolay Petrov
Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
rashmi
Top achievements
Rank 1
answered on 27 Apr 2016, 09:43 AM

Hi Nikolay,

Thanks for a reply.

In the above statement, assert basically stops the current test case execution if window is not loaded,

But I wanted to try something if window is not loaded wait for 2 more sec and then continue till window is loaded.

Thank you,

0
Boyan Boev
Telerik team
answered on 29 Apr 2016, 01:29 PM
Hi Rashmi,

Then use this code:

ActiveApplication.WaitForWindow("yourWindowsCaption", 30000);

In this case Test Studio will wait 30 sec for the window. If it appears during this time it will continue with the test.

Hope that helps.

Regards,
Boyan Boev
Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
Tags
General Discussions
Asked by
rashmi
Top achievements
Rank 1
Answers by
Nikolay Petrov
Telerik team
rashmi
Top achievements
Rank 1
Boyan Boev
Telerik team
Share this question
or