I’d like to Sum Column1 and Column2 and then write the result to Column3. But the question is, how can I do it for all 6 rows in a loop until the last row and then stop.
It’s not an excel table, it’s VB .NET DataGridView .
Use Do while loop
Put your object which contains the selectors inside Do while loop body
assign Counter = Counter+1 inside Do while loop body
Then change the Row 0 with the Counter Variable
in condition put Counter < 6
One option would be to use the Extract Structured Data or Data Scrape Wizard. This would give you a data table, then you can use a For each on it, and you wouldn’t need a counter in this case. Then, I will normally look at the available attributes on one of the cells to see if there is a tableRow and tableColumn attribute, because this would allow you to replace with the index from the For each loop for row number.
‘Row 0’ might be the row number if tableRow doesn’t exist. You would need to replace the number with the index from the For each loop. "<wnd ctrlname=‘dgvList’ /><ctrl name=‘DataGridView’ role=‘table’ /><ctrl name=‘Row "+rowIndex.ToString+"’ role=‘row’ /><ctrl name=‘ColumnName’ role=‘cell’ />"
The newer versions of Studio may handle variables in selectors differently, but my example is editing the selector in the Expression editor where it is surrounded by quotations.
Find children is also an option, but more complex I feel.
Can you use UiExplorer and show an image of what the selector looks like for a few cells in the first row and a few cells in the second row. Also, show an image of some of your code and how you have implemented this. That would help identify what the issue is. The syntax is correct, however, the selector or how you used it could be wrong maybe.
One thing that will help you is output your selector string where you have added the rowIndex on it using either a Write Line or Message Box. Then, you can compare it with what UiExplorer shows that the selector should be. That way, you know if your selector string is correct or not.