Hello,
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:
[Window Title]
Workflow Exception[Main Instruction]
Main has thrown an exception[Content]
Source: Browser window scopeMessage: The UiElement is no longer valid
Exception Type: InvalidUiElementException
[Expanded Information]
UiPath.Core.InvalidUiElementException: The UiElement is no longer valid â> System.Runtime.InteropServices.COMException: Invalid UI node
at UiPath.UiNodeClass.GetTopLevelWindow()
at UiPath.Core.UiElement.GetTopLevelWindow()
â 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.