We are experiencing problems with “The UiElement is no longer valid” message.
We have an unattended robot, managed by the Orchestrator.
Studio Version 2018.4.1, Orchestrator Version 2018.2.6
Our robot is using Chrome browser. To save a document, the robot clicks on a hyperlink, then the browser opens the “Save As” dialog, then the robot specifies the full path for the file name (Type Into), selects a save as type from a combo box (SelectItem), and finally clicks on the Save button (Mouse click).
The problem is that at unpredictable times an exception is raised on the SelectItem activity, with the message “The UiElement is no longer valid”. This happens about 50% of the executions (the other 50% runs fine).
Moreover, this only happens when the robot is started by Orchestrator and nobody is staring at it in front of a remote desktop session. We decided to use a screen recorder, to record what happens on the screen wthout actually looking at the screen.
We saw that the Save As dialog just disappears even before the Type into activity can be seen.
It looks as if the robot is executing the MouseClick (on Save button) before typing the file name and selecting the output format. The click causes the window to disappear, so that when the SelectItem is performed, it cannot find the element any more and it raises the exception.
Could that be an explanation ? But how could the event queue be so un-sequential ?
How can such a behaviour be managed from code ?
Thanks for any hint.