WPF: Wait for disabled button to become enabled

2 Answers 86 Views
WPF Testing
Richard
Top achievements
Rank 2
Iron
Veteran
Iron
Richard asked on 21 Nov 2023, 04:20 PM

In a WPF test, how do I wait for a button that is disabled due to an async save in progress to complete and become enabled before continuing the next step in the test? 

Thanks,
Richard

Richard
Top achievements
Rank 2
Iron
Veteran
Iron
commented on 22 Nov 2023, 05:18 PM

Thank you both, I'll dig into the wait/verification help docs. 

2 Answers, 1 is accepted

Sort by
0
Steven
Top achievements
Rank 2
Iron
answered on 21 Nov 2023, 08:47 PM

Again - don't know if this helps, but you may need to write a coded step using the Actions -> Javascript Events.

SSq

Elena
Telerik team
commented on 22 Nov 2023, 03:23 PM

Hi SSq, 

Thank you for jumping in to the conversation - I appreciate it!

Just wanted to add that the JavaScript events are only used in web applications and will not suit the needs in WPF testing. 

Regards,
Elena

0
Elena
Telerik team
answered on 22 Nov 2023, 03:21 PM

Hi Richard,

The wait and verification steps are also available in WPF test recording and are personalized based on the highlighted element. You can also explore the Advanced verification options in the advanced Recording tools window. 

Let me know if you have explored these already and don't find what you are looking for.

Regards,
Elena
Progress Telerik

Virtual Classroom is the free self-paced technical training portal that gets you up to speed with Telerik and Kendo UI products including Telerik Test Studio! Check it out at https://learn.telerik.com/.
Richard
Top achievements
Rank 2
Iron
Veteran
Iron
commented on 22 Nov 2023, 05:19 PM

Thank you both, I'll dig into the wait/verification help docs. 
Richard
Top achievements
Rank 2
Iron
Veteran
Iron
commented on 23 Nov 2023, 10:07 AM

Hi Elena,

I have read over the docs and I have been able to get TS to wait for a button to become enabled. This is great, thank you.

However, I'm not sure if this is a bug or a feature request (or if I'm missing something). I can't add the wait Enabled step after the test is recorded. I can only add it while recording a test.

For context, the WPF Control I'm examining is a Tekerik RadButton, and Test Studio is correctly identifying that it is a RadButton. 

I'd love it if this Enabled verification option was available in the post-recording editor as with an application that makes a lot of async calls and disables parts of the UI while those calls complete this step will be used hundreds and hundreds of times in our tests. I realise I can run the test and pause it where I need to inject the wait, but again, doing this hundreds of times will make creating these tests very difficult and slow. 

 

Here are the verification options while recording a step

Here are the possible verification options during post-recording test editing  

 

The online help docs seem to indicate that in the past the Enabled check was there

 

Thanks,
Richard

 

Elena
Telerik team
commented on 27 Nov 2023, 01:17 PM

Hi Richard, 

Thanks for taking the time to work on the suggested approach for using the wait and verify steps.

As to your finding about the missing option for Verification if Enabled for an existing element in the Step Builder - I agree that this is a miss from our end. Thus I submitted a bug report on your behalf into our public feedback portal. You can see the public item here and also under your Telerik account. 

Until we include this item in our roadmap you will only be able to use the partial test run options and add the step as you record. One more option is to reuse an already recorded step of the same type and only change its target element

I hope this information will be of further help for you. Let me know in case you have any other questions. 

And thank you for your cooperation once again.

Regards, 
Elena

Richard
Top achievements
Rank 2
Iron
Veteran
Iron
commented on 27 Nov 2023, 03:56 PM

Thanks Elena. 

Duplicating the wait step is a good tip, I'll be using that. 

Cheers,

Richard

Elena
Telerik team
commented on 28 Nov 2023, 11:03 AM

I'm pleased to hear the suggested approach will be of further help for you. Thank you for your time in our conversation! 

Regards,
Elena

Tags
WPF Testing
Asked by
Richard
Top achievements
Rank 2
Iron
Veteran
Iron
Answers by
Steven
Top achievements
Rank 2
Iron
Elena
Telerik team
Share this question
or