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.
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
Hi
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
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.