My workflow is getting a 50/50 chance to trigger following error on microsoft’s website, due to page loading time. I would like to make an exception call that either restarts the workflow or refreshes the website, or maybe both? Examples would be much appreciated :
Execution error : UiPath.Core.SelectorNotFoundException: Cannot find the UI element corresponding to this selector: —> System.Runtime.InteropServices.COMException: Cannot find the UI element corresponding to this selector:
at UiPath.UiNodeClass.FindFirst(UiFindScope scope, String nodeID)
at UiPath.Core.UiElement.FindFirst(FindScope scope, Selector selector)
— End of inner exception stack trace —
at UiPath.Core.Activities.ScopeActivity.OnFaulted(NativeActivityFaultContext faultContext, Exception propagatedException, ActivityInstance propagatedFrom)
at System.Activities.Runtime.FaultCallbackWrapper.Invoke(NativeActivityFaultContext faultContext, Exception propagatedException, ActivityInstance propagatedFrom)
at System.Activities.Runtime.FaultCallbackWrapper.FaultWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
Info:<?xml version="1.0" encoding="utf-16"?>false42.1399122
Hi,
Actually error is about selector so u need to use UiExplorer to choose reliable selector.
avoid dynamic attribiute may be you could have attached “Expression editor” windows of selector for better view.
anyway as your found that its beacuse of delay in page load here is the approach.
1.If you don’t know how long it will take then you can use On Element Appear activity If it doesn’t show up sometime due to network issue then pass the “True” Boolean value in the property ContinueOnError.
2.first approach use On element vanish(A container that enables you to perform one or multiple actions after a specified UI element vanishes.) indicate reload icon as the target (reload icon apears only when page is completely loaded) .Second approach In the Target property we have option called “WaitForReady.” change the status from "Interactive to Complete.
3.IF Above approach doesn’t work then use "Image exist" on reload button and try
4.Use try and catches activity inside “Catch block” ** use send hotkey(F5)** to refresh webpage
5.To retry the sequence which caused the exception you can use “Retry Scope” Activity