How to set the "run on all rows" action call property at run time
I have to import 2 excel workbooks, one in the local data sheet and the other to the global data sheet, the script should iterate only on the rows of the local data sheet but not on the global data sheet. I know that these settings can be set at design time, but it would be good if these can be set at run time for every script. I have found that the setting for global "run on only one row" can be set using the code (from an associated library) :
intRowCount = DataTable.GetSheet(dtLocalSheet).GetRowCount For intRunLoop = 1 to intRowCount
DataTable.GetSheet(dtLocalSheet).SetCurrentRow intRunLoop 'Your whole script goes here Next
This has a more important purpose. The first column in my local data sheet is titled "Run" and if I leave it blank for any particular row, this row will be skipped, but if I put anything in the column for a particular row, the column will be run. This allows me to easily and instantly select specific rows of data to be used or skipped based on my current testing needs.
So the whole code looks like this:
'We get the number of iterations in the local DataSheet
intRowCount = DataTable.GetSheet(dtLocalSheet).GetRowCount
'We loop through each row and check to see if the Run column is blank. 'If it is blank, we skip that row. 'Otherwise, we run this iteration using the current row of the local DataSheet For intRunLoop = 1 to intRowCount
strRunRow = DataTable("Run", dtLocalSheet) If strRunRow <> "" Then 'Your whole script goes here Else
Reporter.ReportEvent micDone, "Skipping Iteration " & Right("00" & intRunLoop, 3), DataTable("Description", dtLocalSheet) EndIf Next
Last edited by BlakeWalker84120; 04-23-2014 at 08:34 AM.
"The last 10% of any software project will take 90% of the budgeted time. The first 90% will take the other 90%"