Question
Unable to loop through a Grid - Openspan
Hi Team,
I want to click each and every row of java table grid and perform some operation. I was able to get the total rowCount of the Grid as well but the "For Loop" is not working and facing the below issues. Can you please help!
1. Am unable to set the grid Rowcount to ForLoop Limit(Currently I have hardcoded to 1000)
2. The ForLoop is not iterating.
**Moderation Team has archived post**
This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.
Arunk,
The RowCount property is a data property that supplies how many rows are in the grid. You should use the RowCount property to set the limit of the for loop.
Instead of connecting the RowCount to the Startloop of the forloop1 using execution output (the yellow dot to the right of the design block), you should connect the data output (blue dot right to the design block) to the limit input of the for loop. You will likely need to right click the limit: 1000 section of the for loop and select reset in the context menu that pops up so that the data input (The last blue dot at the bottom of the for loop) enables for the RowCount output connection to be made to the Limit input.
You will then need to change the ClickCell block to connect from the Yielded output of the for loop (the second yellow dot of the forloop1 that is off to the right) instead of the Startloop output of the forloop. Whenever the forloop1 detects that there is another iteration to be made, it will execute the automation logic out of the yield.
Lastly, instead of using the Increment data output (second to last blue dot on the right side of the forloop1 block), you will need to use the Index data ouput (first blue dot to the right side of the forloop1 design block) to the row parameter. The index will change with each iteration allowing you to increase each row per iteation. The Increment only tells you how much of an increment occurred with each iteration. The index lets you know which index of the loop you are currently on.
Below is a help link that explains in detail about how the forloop parameters look. Please have a look for future references.
http://help.openspan.com/80/Components/ForLoop.htm