Could you please explain why my workflow gives an error when my browser is closed?
My workflow starts with opening Chrome and typing a URL into the search bar.
- If I start the workflow with Chrome already open, it opens a new Chrome window. Then it switches to the original window and types the URL in the search bar.
- If I start the workflow without Chrome open, it opens a new Chrome window. Then within two seconds it gives the following error:
Main has thrown an exception
Source: Browser window scope
Message: The UiElement is no longer valid
Exception Type: InvalidUiElementException
UiPath.Core.InvalidUiElementException: The UiElement is no longer valid —> System.Runtime.InteropServices.COMException: Invalid UI node
— End of inner exception stack trace —
at UiPath.Core.Activities.ScopeActivity.EndExecute(NativeActivityContext context, IAsyncResult result)
at UiPath.Core.Activities.AsyncNativeActivity.BookmarkResumptionCallback(NativeActivityContext context, Bookmark bookmark, Object value)
at System.Activities.Runtime.BookmarkCallbackWrapper.Invoke(NativeActivityContext context, Bookmark bookmark, Object value)
at System.Activities.Runtime.BookmarkWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
This is what the start of my workflow looks like:
This is the selector I am using as an input into the WindowScope activity. (There is a < symbol between the " and the html.)
“html app=‘chrome.exe’ />”
I have looked at the other threads with “UiElement is no longer valid” and I don’t think this is the same issue.
I have tried remaking the workflow with Firefox, but I’m encountering a different error there. I’d like to solve this in Chrome before figuring out other browsers.