jsreesoap
11 years agoContributor
[Rs]Executing test case in iterations by incrementing values
Hi
I am trying to run a test case in iterations- Here is my requirement.
In each iteration the appended number to a string should get incremented like 'offername1' in first iteration and 'offername2' in second iteration and so on. I tried
import com.eviware.soapui.model.testsuite.TestStepResult.TestStepStatus
for(i in 0..8 )
{
def incrementValue = context.expand( '${#TestCase#incrementValue}' )
log.info "incrementValue derived" + incrementValue
incrementValue = incrementValue.toInteger()+1
testRunner.testCase.testSuite.setPropertyValue("offerName","offername"+incrementValue)
testRunner.testCase.testSuite.setPropertyValue("ticker","ti"+incrementValue)
testRunner.testCase.setPropertyValue("incrementValue",incrementValue+"")
testRunner.gotoStepByName( "ClosingDate groovy")
testRunner.runTestStepByName( "ClosingDate groovy")
if (i==4){break}
log.info i
}
but it wouldn't stop when I value is 4. I am doing something wrong. Attached screen shot shows the test case structure.
Pls let me knwo how I can achieve this.
Thanks
I am trying to run a test case in iterations- Here is my requirement.
In each iteration the appended number to a string should get incremented like 'offername1' in first iteration and 'offername2' in second iteration and so on. I tried
import com.eviware.soapui.model.testsuite.TestStepResult.TestStepStatus
for(i in 0..8 )
{
def incrementValue = context.expand( '${#TestCase#incrementValue}' )
log.info "incrementValue derived" + incrementValue
incrementValue = incrementValue.toInteger()+1
testRunner.testCase.testSuite.setPropertyValue("offerName","offername"+incrementValue)
testRunner.testCase.testSuite.setPropertyValue("ticker","ti"+incrementValue)
testRunner.testCase.setPropertyValue("incrementValue",incrementValue+"")
testRunner.gotoStepByName( "ClosingDate groovy")
testRunner.runTestStepByName( "ClosingDate groovy")
if (i==4){break}
log.info i
}
but it wouldn't stop when I value is 4. I am doing something wrong. Attached screen shot shows the test case structure.
Pls let me knwo how I can achieve this.
Thanks