Data Scrape- Next button Endlessly Cycling

Im working on a robot to go to a website, hit a Select All radio button and export to excel and then loop to the next page (no way to select all data across pages). Ive got everything running nicely expect the Next button doesnt go away on the last page, it is just disabled. I assume because its still there, the robot continues to cycle clinking the next button when the link is gone. I cant figure out how to end it. Its a private website but let me know if there are specifics I can provide.


The Next Button along with some counter fields that may help…

I tried grabbing the counts and creating a decision flow to test if one variable (current count) equals another variable (total count) so 355=355 and then to end the process. But Ive had quite a few issues identifying the number correctly each time and with the logic. Hoping there is a easier way I am just unaware of.


Just to clarify, even when the ‘next’ button is disabled the robot still finds the selector as if the button is still enabled and clicks the disabled button? Also, would it be possible for you to to scrape that data from each page instead of exporting the data from the site to Excel? If so, you may be able to use a ‘scrape structured data’ activity which could also help with your looping issue.

If scraping is not an option, you could use a ‘get attribute activity’ on the ‘next button’. Use UiExplorer to determine the attributes of the element when it is enabled. Then, use a while loop to have the robot click the button when it is enabled and have the logic of the while set to no longer click the button once the attribute of the element are no longer in the enabled state.

I have attached an example xaml to demonstrate

The example is scrolling through previously viewed web pages in Internet Explorer using the previous page button. By using UiExplorer to identified the status of the ‘aastate’ property of the button when it is disabled / can’t be clicked (screenshot below), it can be used to break the while loop when its aastate property is set to “unavailable”.

Main.xaml (15.2 KB)

1 Like