Use Application/Browser wait for program to load/open

Hello

I am using the “Use Application/Browser” to open Microsoft Dynamics NAV.

The problem is that the program takes ~30 seconds to “fully open”, but the activity sees the program as open right away.
This means that when passing on the Output UiElement, I get the “UiElement is no longer valid” error in the next activities.

I dont see the “Wait for load”, “Visibility check” or “Validation” as part of the Use Application/Browser activity, so how can I wait for the program to fully load/open?

The “Check App State” activity does not help, as the Output UiElement is already generated by the (almost) instant completion of “Use Application/Browser”.

Regards
Soren

@SorenB,

Use Check App State in your Use Application/Browser to open Microsoft Dynamics NAV.
Only after Check App State finds a desired element then only return your code control to another flow or activity.

Hi @SorenB

Select the inner window of the application It will match with the Title of it. & It will wait till it opens.

It’s interesting that Use App/Browser doesn’t have WaitForReady property. What activity is failing with “UiElement is no longer valid”? Can you show screenshot of workflow and activity properties?

Hello @ashokkarale

I have tried putting a “Check App State” inside the “Use Application/Browser”, but the problem is that the “Use Application/Browser” is already executed (and finished) and therefore have already generated the Output UiElement.

Hello @AJ_Ask

I have no luck in selecting an “inner window”.
Please supply an example if possible.

Regards
Soren

For example this would fail:

Why not just use a single Use Application/Browser instead of two? Or is this only for demonstration?

Only for demonstration.
Any activity that uses the element will fail.

This is how I understand the flow:

Can you show properties panel of both Use App/Browser activities?

Cannot recreate the issue.

1st Use Application/Browser:

2nd Use Application/Browser:

To debug this you can log message after 1st Use App/Browser with your OutputUiElement.Selector.Text, copy it to Ui Explorer as see if it validates.
Workaround you could try would be to put Get Active Window, use ApplicationWindow from this in Input Element for Highlight and then output element will be your ui element for window. Can’t verify if it’ll fix it as I don’t have this issue.

2 Likes

It seems the problem related to the Output Element of the 2nd Use Application/Browser activity.
I was trying to convert the UiElement to a Window-type argument to support legacy processes using this library.

Your sugestion of using “Get Active Window” did the trick - thank you.

Regards
Soren

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.