Is there a tip or trick for a website that keeps changing the JS path for the same element

I created a macro that works perfectly.

I want the macro to do several things, example, click the YES button then continue. I created this action:

and works like a charm, now the next day I log in, and the website changes the coding, now it's "l" instead of "m"


Is there an easy way to find what the JS path is as part of the macro so the action keeps working even if the website decides to change the JS path?

I appreciate your help!

I'm not a JavaScript programmer, so I can't give you the best answer, but it seems to me you could use some brute force here by writing 26 consecutive actions using the letters a-z. The ones that aren't using the correct letter will fail, but as long as you set the flag to ignore fails, that should still work.

1 Like

Try using a shorter CSS selector path. If you copied the CSS selector using Safari's web inspector (or, presumably, Chrome's equivalent), it will usually give you way more info than you actually need to target an element.

For instance, do you really need to specify #Dm-5 or #Dl-5 or whatever? Can you perhaps get away with just specifying label.FastComboButtonItem.FastComboButtonItem_Yes.FastComboButton.FRC > span?

Obviously, this will entirely depend on how the site you are working with is coded, but play around with using the shortest possible CSS selector path necessary to target the specific element you want.

1 Like