Question
Get-clones | Listloop not reading all clones | Could not find instance from KeyProvided
In my automation I am using usekeys/get-clones, and with a listloop I want to read every clone. The listloop is not iterating though all the clones, but stops half way with an error message:
Could not find instance from Key Provider. KeyName: Key KeyProviderName: Rows
When I do the interrogation I can see that all the objects are matched, all the rows are being shown, I cannot see any difference between rows that are being yielded, and rows that are not being yielded with the listloop.
I've implemented serveral pauses to slow down the robot and give the method get-clones enough time, but speed is not the issue...
Any ideas?
You're probably not waiting long enough for all of the clones to match. In your automation you are performing a WaitForCreate on one of the cells and providing a key of None. This means it will only wait for the first one. For some reason, you are performing a Rematch and then pausing for 2.5 seconds before you iterate the rows.
When handling clones like this, there's no specific event you can wait for to tell you that all of the clones are matched. If you have a label or something on the page that tells you how many there are, you can get the count of the clone collection and compare it to that value to see that they are all there. If they aren't, you can wait longer.
If you do not have a known value for how many there should be, then I prefer to just wait until the count stops changing. In either case, you'd have a loop very similar to what I describe below.