Loops Find image with an anchor base

Hi all,

New here. I am trying to figure out a way to have a bot look through a web browser and find all check boxes that have been checked and click the link that is to the right of the checked boxes.


That is the image of what I am trying to do. As you can see for now it has 1 box checked, and I was able to do a regulator anchor base with a find image activity and click activity for UI element; however, Not sure how to loops this so the bot goes and scans through the enter site to basically click the link on the right for every box that is checked.

Could use some help here. Thanks!

There might be a way to do this by going directly to the link with a selector.
I would suggest using UiExplorer first to see if there are any attributes that can identify a “checked” and “unchecked” box. Then, just simply use that selector with the attribute in either the Anchor Base or Get Attribute activity (using Get Attribute you can get the tableRow and use it for the link next to it in the Click actiivty, or just use the Anchor Base)

After you perform the first link, then have the check box unchecked, so you can do the same thing for the next check box. Do this inside a Retry Scope with an Element Exists, so it will keep clicking the link until the checked box doesn’t not exist.

So those are just some simple ideas.

The other way would be to use Find Children, but using its Filter property is not something I used often. But, essentially, you could loop through the children elements that has the checked attribute, and Anchor Base using it.

You can also run a loop using a counter and using it on the tableRow attribute.

My first idea would look like this maybe:

Retry Scope
  AnchorBase using checked box
  Check: Uncheck box
  Element Exist
Condition: Is True: Not boolElementExist 


Hope these steps could help you resolve this
—hope we are able to select them as individual element
So use datatable scrapping to scrape the whole table
And get the datatable named ExtractedDatatable
—now use a for each row loop and pass the above variable as input
—inside the loop use find text position activity and pass the input as row(“yourcolumnname”).ToString
And get the output as UiElement variable named out_element
—now use retry scope activity and inside the loop in the above part use a sequence with set Of activities like
—-inside the retry scope at top part
—Use Anchor base activity and in that left side use a find element activity as anchor and pass the variable out_element as input to the ELEMENT property in the property panel of find element activity
To the right side of anchor base activity use click image activity and click on the check box
—then use a send hot key with pgdn key

—then in the condition part use a activity called ELEMENT EXISTS where again pass the same out_element as input to the ELEMENT property in the property panel of element exists

Hope this would help you
Kindly try this and let know for any queries or clarification
Cheers @cambiukpytou

1 Like

Just to provide additional information. I have create a message box to let the user first click off which boxes they need the link to be clicked.

So the user will check the box, then the bot continues to run and clicks links on all boxes that are checked.

If I understand correctly, you are setting it up to click link on first box, then uncheck the box, and have it run again on the next box that is clicked?

That was my initial thought, where you could use a selector that finds the first checkbox that is checked. So when you uncheck the box, it should find the next one that is checked. That is, if you get the selector correct.

So it does have a selector for check box. However there is no difference in the element between an actual checked box and unchecked box. It just identifies it as a checkbox

Did you look at every attribute in UiExplorer for the element? There might be one that says “checked” or “unchecked” somewhere in the text. Feel free to post a screenshot of all the attributes.

If not, I guess you will need to take a different approach.
There are various ways to approach this differently. One way might be to use Data Scraping, so you can capture the text of all the links. Then, for each link, use Get Attribute for the tableRow, and use the tableRow variable in the selector of the checkbox, which then you would need to use another Get Attribute to get the “value” or “checked” attribute (check the html of the checkbox for the attribute by using “Inspect Element” in your browser). Check that attribute to make sure it is checked, then simply click on the link using the text from your datatable in the selector.

As an alternative to using the tableRow, you can try using the Anchor Base for this as well, where you use Get Attribute to the left of each link.

Instead of using DataScraping, you can also use Find Children, but you should filter the children to the ‘A’ tag, then again use Anchor Base (or the tableRow method) to Get Attribute of the checkbox and verify if it is checked or not.

There also has to be a way where you can Find Children of the checkbox and filter it by the checked attribute. This would solve any slowness in looping through every row item.

Hopefully, I didn’t confuse you. If you choose to explore Find Children, I would suggest searching the forums for examples.