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”.
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.
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?
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.
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.
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.