"Cannot find UI element to this selector"

Hi again peepz

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 :slight_smile: :

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

Best regards

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


Hi ddpadil
Thanks for the swiftly reply, i tried try catch or retry scope but cant get it to work as it should.
Is it possible to provide an example?

Best regards

What abut approach 1,2,3?

Tried 1 and 2, 3 is not so reliable if selector is found, so 4 and 5 is more suitable

Got time to make some examples? :slight_smile:

Hi, I gave reload icon in target. But UI Path didn’t recognize it as image.

Hey team. somehow Reload button not recognize by UI path. I tried both On Image Appear or On element Appear. Both are not working as expected.

I used on image vanished, on image appear didn’t work for me either.