Well, you're using an entirely different way of iterating the objects than I am. I'm going simply by rows, searching only a single column until I find the text I'm looking for. I'm looping through those twenty rows. If I don't find it in that 20, I then send a command to scroll down the table.
I repeat that I don't know the specifics of your application, table type, etc. So... depending upon how the control is rendered, the specific code itself is going to have to be up to you. If you want us to be more specific, please provide screenshots of the Object Spy for your table object including all properties and methods.
Basically, if you don't find it in the 20 rows, you send whatever command you need and then repeat the loops. Given your code that you provided, I would put a while loop like I have around your nested for loops. Within your second for-loop would be your check to see if you found what you wanted. If so, set the boolean and break the for loops. Within the while loop, if the boolean isn't true, send the necessary command to your table to scroll down the table to get the next set of 20 rows.
The only thing out of all this that is TestComplete specific is whether or not you use a "Keys" command to send a "PageDown". Everything else is JavaScript.
Robert Martin
[Hall of Fame]Please consider giving a Kudo if I write good stuff
----
Why automate? I do automated testing because there's only so much a human being can do and remain healthy. Sleep is a requirement. So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.
Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available