How to make a click action if selector attributes value gets change

selector
studio

#1

Hi,

If I have Web Button (XYZ) and below is its selector identified by UIExplorer & through recording too for Web Page.

Now, suppose the developer changes the value of aaname to “ABC” or change href=‘www.abcd.com/xyz.html’ so while execution it will not recognize and fail.

Can UiPath identify the value change automatically?

In UiPath we can click the element through Image recognition too but as we are getting selector then why to go for Image click.

Is their any feature available if selector gets failed then use Image to click. or vice versa.


#2

Hi @neeraj83

In aaname=’*’

  • Is indicating any value come in that.

Regards,
Arivu


#3

The wildcard * (like Arivu mentioned) is useful if you can find an attribute that is less likely to change on you. Other than that, there’s no way to detect a change through selector recognition except when it fails.

You can program this in by using a Try/Catch, if you are concerned about things changing on you. I usually find that Image recognition takes longer though and sometimes requires a maximized window, but make sure you set the TimeoutMS to 0 or a small value when suspecting that the element should be on the screen already to speed up the failures.

I guess it depends on the risk of the project failing versus process time efficiency. It will also be helpful if you store the elements/selectors in one place so you only need to change it one time when a change occurs. Like for example, you store the website “www.abcd.com” or “www.abcd.com/xyz.html” somewhere, so you can use that variable in the selector… likewise, you can use containers (eg Attach Window) where the website is only needed one time.

Regards.


#4

Thanks Guys!!