Click on a Button based on an specific text

Hello,

I’m building an automation that twice a month must acces a website a download the lastest edition of an archive.

Exemple:
image

As show in the image above, I have lots of itens in a list and i need it to click always in the button next to the lastest “Edition”.

Problem is, the order of the list is always changing because of other archives (Generic description) added through the month.

What can i do to make the robot identify the right button to click, based on the text beside it?

@luan.quirino1

You can inspect the selector of the buttons
Use UiExplorer and add the innertext tags etc to make the reliable selector

Hope this may help you

Thanks

1 Like

HI @luan.quirino1,

Per you screenshot, I sense, latest edition would always be on top in the 2nd row?

So, you can identify the selector of that position using attributes like aaname,text,innertext,tablecol,tablerow etc… Once identified, just do +1 to the tablecol value to click element next to it.

Before doing this, please indicate both elements using Uiexplorer and find the relation between selector of latest edition value and selector of Ok button.

That way you will be able to make dynamic selector :slight_smile:

Regards
Sonali

Hi @luan.quirino1 ,

You can also follow below steps:

1 - Read this list from find children activity.
2 - Iterate each uielement and get it’s inner text from get Attribute activity
3 - Use if condition if innertext= yourtext then click on button .

Please also share Ok button selectors so that i will check and make it’s selector dynamic with respect to text retrieve from get attribute.

Thanks.

The problem is that the lastest edition is not always in the same place the order might change. Somtimes it can be the first, other ir can be the third and at a moment it can be the second. Thats why I’m having trouble with it.

1 Like

Hi @luan.quirino1

lastest edition mean the edition text which contains number (larger )right, if not can u please clarify around that as well?

That’s right.

Then the logic u can apply is

  1. Scrap all names by datascrapping, filter by edition and extract the number next to it by string manipulation or regex, then find which is the maximum and after that, use anchor base method to find that edition number by applying dynmaic selectors.

Other way alternative to this is using css selector, it would be faster than anchor base method,
create a css selector based on edition number

Regards,
Nived N

These are the button selectors:

image

I think this logic might work. Could you detail it a little bit more, please?

Please click on UIExplorer and share that screen.

Is this one OK?

Okay, So you have tableRow whose counter is increasing.
So you have to make it dynamic by passing counter value.

Hi @luan.quirino1 ,

Try below skeleton of workflow and inspect elements accordingly.
Test.xaml (11.5 KB)

Don’t forget to pass index variable to your click activity So that bot clicks “OK” button dynamically.