This web page can contain x amount of lines and there is no Next page.
I am using a “For each” and it works well in the beginning but after around 18 lines it stops without any error message and I do not understand why.
The for each doesnt have limit and has input mode of Simulate:
It’s due to dynamic nature of your list of rows.
Check manually scrolling to the bottom first and then try using for each UI element activity is able to iterate through all the data.
If that works, use mouse scroll activity to scroll down to the last item and then do the iteration.
Hi @ashokkarale
thanks
indeed when i try to scroll, it starts the list from the current position and not from the beginning. Do i need then to do kind of a loop with For Each + Scroll and keep on going?
Ok thanks.
Using a scroll with a for each doesnt seem very intuitive - indeed scroll to the position where the for each has ended isn’t straightforward.
Don’t know if anyone has experience with this…
within for each, put your click activity within try catch.
now for element after 18th item or other item where bot fails to click the item, it will generate an exception, catch that system using your catch block.
now within your catch block, provide the mouse scroll activity only to the point where 19th item and onwards is visible on the screen. You will have to figure out by scrolling manually first, how many scrolls it takes to show elements like this. Then enable the scroll accordingly.
after mouse scroll in catch block, use the click activity again. Now bot should be able to click on your 19th item and other ones visible on the screen.
next time, again it will most likely fail when next scroll is needed so will come in catch block where you have already implemented scroll and click activity.
thank you Sonali
I have few suprises with “For each”, first by trying some tests I see that the amount of lines executed isn’t always the same nor related only to the lines that are visible on the screen. So the number of scrolls doesn’t seem to be easy to identify. I believe I will need some assistance from a freelancer here, as I don’t have much knowledge / experience on UiPath.
Thank you anyway !
You can’t just run it infinitely. You have to have some sort of defined stopping point. What’s the maximum amount you want to process? Define that, then click whatever button or element loads more elements as many times as you need to in order to expand the number of rows you want. Then extract the data.
Thank you,
even by setting a limit, at 5 for instance, I am not able to understand how to start at the next line.
By scrolling down by 1, it still picks up the first line, that has already been processed…
As I said, scroll first. Scroll as many times as you need to get the number of records you need, then extract the data. Are you using Table Extraction?
Hi Paul
This is exactly what I tried, first scroll then run a for each to click on each button of the table. Unfortunately by scrolling first, the loop doesn’t start at the beginning at the table but further down.
No I am not using a table extraction, do we need to use it to click on the buttons that appear on the table? Sorry my questions might be silly as I have recently started using UiPath.
Thank you
I think you are using “extract table” activity based on screenshot you have shared of activity property in main post unless there is new update to “for each” activity.
As others have suggested for each is one of the ways to solve this.
As i understand, You need to go through X number of rows which can vary from case to case, plus you are on a web application, so i am hoping it is HTML table you are going through.
Pls try to the below logic to solve this:
Take “Check app state” activity and try to work around the selector to make it dynamic such that it is a pattern which can be used to identify all row using single index (idx in selector) Be patient finding selector will take time!
if row found, click on button(Again dynamic selector based on row and assuming that button can be clicked in background like simulate method)
else, row not found, you have reached end of table/ rows are not present at all
Use do while/while with condition as true which will allow it to run infinite, but the loop will break/end if row not found.
In case you don’t want to use infinite loop, use “Extract table” to get whole HTML table, it will save data into variable data table, from where you can get the row count which can be used as end condition for do while/ while loop.
This will skip the scroll thing unless it is required by the web app to load the rows in HTML table.