I want to Click OK button after the grid is loaded, because the OK button is inactive during the loading of the list.
I tried Element Exists activity for the first line to be present and then click. But it doesn’t wait until the end of loading and tries to click the OK button during the loading session. (Timeout is set to 600000 milliseconds)
What is wrong with the activity I’m using? If it’s not possible with that way, any other suggestions will be appreciated like checking the button if it’s active.
@Jenni_K
element exist is the right approach, but it is fired one time.
You reacted on this with the loop, or the retry scope acitivity is an option.
But some times an element exists, but application is not fully ready.
Have a check if you find something that is triggering when the ok button is active or not and use this for sync
Here an analysis in UiExplorer is to do. Click on the inactive button wile loading and explore the properties (left pane). then reindicate or refresh the properties for the active button.
One info would help us, what type for application is it?
It’s a VB.NET application, WindowsForms screen. When the button is inactive, UI Explorer couldn’t retrieve its properties until the loading is finished. After loading finishes, Property Explorer (left pane) is filled for example: aastate: focusable etc.
it is risky but then give a try with get attribute in a loop along with try catch. In case of the button is not returning any info while loading, then returning attributes could indicate the load status.
But it is risky as well. Kindly note: I updated my previous post. Have check on last version as well
Yes i was expecting that you will use in loop, plus try catch on get attribute
But do the time out to 5000 seconds,
let delay the next loop with 1,5 seconds
and the loop condition is that a particular attribute has a particular value.
this pattern is just a variation from the retry scope activity
The example file you posted really helped a lot. But still there was a little problem for me. Here is what I faced and what I figured out:
I used Get Attribute activity to get aastate of the button in the Try Catch block. In some point of the loading, it took the inactive OK button’s attribute as “unavailable”, not “null” as I expected. So, that means it may somehow take the attribute while loading, and this made the “IsNullOrWhiteSpace” check to fail.
So I changed the loop: do while aastate is ‘unavailable’. When aastate turned out to ‘focusable’ state, I finally use the Click to click the active button! (Click is not shown in the screenshot)
Thank you very much for your help! And if it needs modifications, let me know please.