I'm trying to click a link in each row of an HTML table, which has the following structure:
+---+-------+
| 1 | link1 |
+---+-------+
| 2 | link2 |
+---+-------+
| total: 2 |
+---+-------+
I'm trying to use OpenRPA to do this. But there is no "get all elements" activity in OpenRPA, unlike Selenium. The best approximation is the "get table data" activity. But the problem is that it will throw an exception when reading the above table, because the first and only column of the last row does not consist of an integer like the first columns of the previous rows.
I'm really lost. How could I accomplish my goal with OpenRPA? Many thanks.
Get Element has a MinResult's ( default 1, will throw an exception if nothing was found, so set this to 0 if getting nothing is acceptable ) and a MaxResults ( default 1, set the max number of items to get. ) There is a small overhead on looking for more objects if there are no more objects ( say you want 20 but there is only 18 ) hence we set this to one by default since most of the time this is what people want.
Now, if you use Get Element to find all links in a table, if you click one of the links you will be most likely leave the page. Since GetElement return "live" objects that will break all the results in Get Element, hence you cannot click the "next link". The easy solution is to save all links in a list or collection, and once you have all the results, you loop through each link and open them. This will not work, if links are handled by javascript events, in that case you need to repeat the "get elements" after clicking each link, and then find some unique feature of each link, so you kan skip links you have already clicked