Incorrect Values for Loop Variables

When you write a for loop or a while loop, be sure that the initial, final, and step values for the variable that controls the loop are correct. Incrementing a loop variable one time more or less than you really want is a common source of errors.

To ensure that a control loop works as you expect, click Debug > Step Into in the Silk Test Classic menu to step through the execution of the loop one statement at a time, and watch how the value of the loop variable changes using View > Local Variables. See Stepping Into and Over Functions.