How to configure the Click activity when the same selector exists on the same page

I always refer to your resources.

I am currently automating a page that has multiple objects with the exact same selector except for “aaname”. Since “aaname” is variable, I am trying to set the click activity while disabling that part, but it’s not going well, and even when I set it based on an anchor, I encounter errors.
(The modern activities did not work because the page switches.)

Furthermore, I cannot know the value of “aaname” in advance, so I cannot store it in a variable.
If anyone knows how to configure the click activity in this kind of situation, could you please share your guidance?



Hello

First, I think it’s a good idea to use UiExplorer to check which selector attributes are available. The rest depends on the overall situation, but for example, if the aaname is always xxxx.jpg and there is only one in the screen, you might also specify it like '*.jpg'.

Thank you for your message.
I checked UIExplorer, but everything is the same except for “aaname.”

“aaname” is jpg, PDF, png, but do you know if it is possible to set something like an OR condition?


You can use regular expression search in selectors.

"<webctrl aaname='^.*(jpg|JPG|pdf|PDF|png|PNG)$' matching:aaname='regex'/>"

After rewriting based on your description, it worked as expected without any issues. Thank you very much.