Forum Discussion
SmartBear_Suppo
Alumni
12 years agoHi,
Why don't you run the loop for( i in 1..9) ?
Otherwise, you can keep track of the iteration over i using a TestCase property and if you have run 9 times, use the "return" command if that condition is met outside the loop so that what comes after the loop will not execute.
//retrieve value of i from TestCase property (ex: starting from 1)
//use an if statement to run the statements that were within the for loop
if( i <= 9)
{
...
}
//increment i
//set value of i as TestCase property
//test if i = 9 then return
//rest of script
Regards,
Giscard
SmartBear Support
Why don't you run the loop for( i in 1..9) ?
Otherwise, you can keep track of the iteration over i using a TestCase property and if you have run 9 times, use the "return" command if that condition is met outside the loop so that what comes after the loop will not execute.
//retrieve value of i from TestCase property (ex: starting from 1)
//use an if statement to run the statements that were within the for loop
if( i <= 9)
{
...
}
//increment i
//set value of i as TestCase property
//test if i = 9 then return
//rest of script
Regards,
Giscard
SmartBear Support