How to correctly validate selector in Click Image/Text and Element Exists?

When the page is dynamic and keeps changing, the error says the UI element is not valid. How Can I make sure it remains validated? This error mainly occurs when I use Click Activity (Click Image/Text) and when I use Element exists. How do I use the edit selector perfectly so that I can avoid these errors?

@Samraat_Maharjan

Explore the selector in the ui explorer tab and find a better selector for using the attributes presennt in it…

From the centre panel try including two lines if they are reliabe…

And ui element no longer valid might occure sometimes because the element might be identified but again the page is refreshed so please try including those activities in a retry scope ao that first time it might fail but it retries and would be sucessfu

Hope this helps

Cheers

Hi @Samraat_Maharjan

If The selector is not valid please try to check in uiexplorer in the branch tree, There you can see the attributes like AAname, aatitle <,idx
these kind of information you can see there ,
If the selected element is not valid you can use the wildcards = */?
If the selected element has multiple similar elements than you can use the IDX=1 Or 2 as per the element position, idx= value must be integer.

When setting selectors for Use Application/Browser and other activities, go into UI Explorer and edit the top-most selector which should be the “Window Selector”. This usually defaults to the browser type and and the title on the tab of the browser. If I want my activities to always work on a website there the title changes, you could always add a wildcard to the title, or un-check the title selector and use the “URL” selector with wildcards to make them dynamic.

Example on this UiPath Forums Page:

" html app=‘msedge.exe’ title=‘How to correctly validate selector in Click Image/Text and Element Exists? - Help / Studio - UiPath Community Forum’ "

Change to :

" html app=‘msedge.exe’ title=‘*UiPath Community Forum’ "

This would then work on any UiPath Forum page regardless of the title/post. Could use with Title or URL as stated earlier. Hope this helps.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.