PriyeshS
11 years agoNew Member
Loop extending in the last run
I am facing issues with a script i have created for looping through the test steps. The script -
def count = context.expand( '${RequestData#Count}' )
//log.info count
import java.math.*;
def groovyUtils = new com.eviware.soapui.support.GroovyUtils(context);
def j
def x=count.toInteger()
def CountNew = count.toBigDecimal();
log.info CountNew
def Addition= 1
Count=CountNew.add(Addition)
groovyUtils.setPropertyValue("RequestData", "Count", Count.toString())
log.info Count
for(j=x; j<10; j++)
{
if(j<10)
{
testRunner.runTestStepByName("teststep1");
testRunner.runTestStepByName("teststep2");
.
.
.
.
.
.
break;
}
}
The issue is that even after reaching the max value for the looping vaiable, teststep2 is being executed.
Any help is really appreciated.