I am looking for advice on what the best practice is to run through the children of an HTML table on a webpage in order to click on a specific aaname. I have gotten close but not exact. My program currently prints out all the aanames in the table, but it wont grab the specific one that I have assigned to a variable. Thanks
Did you try using Find Children Activity with the filter set to the list of specific table rows that you want to extract?
You will get a List of all the Matched UiElements. Use ‘Get Attribute’ to get the particular attribute value you want to extract (i believe ‘aaname’). Have an If condition and perform your operation if it matches the value that you want.
Let me know if that whats you are looking for. If not, attach a screenshot/workflow or may be the operation that you want to perform or the criteria based on which you perform the action.
Web Page Table
What you are saying makes sense but I’m not sure exactly how to complete it. I will post screenshots with an explanation of what I’m looking to accomplish.
Actually the information is somewhat confidential so i will try to explain what I have done. There is a table on a webpage with 6 columns and four rows. I have used a find children activity on the column that contains the row/cell I ultimately want to click. I have not edited the specific filter. I ideally want to iterate through the rows of that column looking for the specific aaname that I assigned to a variable in order to make a click on it. If this makes any sense, I would appreciate any help.
Here is the sample workflow that i created. It basically loops through an HTML Table that has checkbox and click on the 3rd row. You can have a look and try to modify it as per your need.
DataTableWithCheckBox.xaml (10.3 KB)
Let me know if it helps.
Your example definitely helped but I think I may have explained my issue wrong. The table I am traversing has 6 columns, one of them being a list of employees. I set the find children selector to be the column header for employees. Underneath that, there are 4 employees and I want to click on the one I assigned my variable to. So I guess it is not really a row. I tried to use the GetAttribute and 'tableRow" but I don’t think it is actually going through the list of employees underneath. I am not sure if it is a problem with my original find children selector or the fact that it is not really a row.
No. Your selector for Find Children activity should be indicating to the whole table. Not to any specific column.
As the name indicates, selector of the Filter should be the your employee name(in your case) that you want to click. Since in this case i am clicking on checkbox, i have kept that as the selector to filter.
Selector for the first row, first col:
<webctrl tag='TD' tableCol='1' tableRow='2' />
Similarly selector for the second row, first col:
<webctrl tag='TD' tableCol='1' tableRow='3' />
Hence i can define my selector for the whole list of checkboxes as:
<webctrl tag='TD' tableCol='1'/>
Since i want to click on 3rd row, I used ‘Get Attributes’ to retrieve the value of ‘tableRow’ which in my case is 3.
Putting that into an ‘If’ condition with a click activity will only click on that particular element. In your case you should be retrieving the attribute that has the name of the employee. May be ‘aaname’ and use that into an ‘If’ condition.
Let me know it its still not clear.
This makes a lot of sense. I’m going to test it out and I may come back later if I run into any problems. Thank you so much for your time and effort.
I have used your solution on a similar table on a website. It is working and I am able to iterate through each line. But I need the bot to get the text from each line but on a different column. I have tried Get Text, Get OCR Text, Screen scraping, but without success.
Do you have any ideas on how I may be able to get this done?