"Cannot find UI element to this selector"

studio

#1

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
Extinguir


Cannot find the UI element
#2

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


How to scrape or get hidden elements value in uipath
Why 'element exist' activity is ok at sometims, but somtimes cannot
UiElementExists takes a long time to execute
#3

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
Extinguir


#4

What abut approach 1,2,3?


#5

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


#6

Got time to make some examples? :slight_smile:


#7

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


#8

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.


#9

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