jsreesoap
11 years agoContributor
[Resolved] Looping through does not stop
I am trying to execute a script in iterations- in each iteration the value of the property should have a appended number lik 'xyz1' in first iteration and in the next one 'xyz2. Its a REST API request
It is workig well but the execution would not stop.
def incrementValue = context.expand( '${#TestCase#incrementValue}' )
Below is the one for incremental value:
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+"")
//log.info incrementValue
Below is the script to run it in iterations:
import com.eviware.soapui.model.testsuite.TestStepResult.TestStepStatus
for( i in 1..4 )
{
testRunner.gotoStepByName( "ClosingDate groovy")
testRunner.runTestStepByName( "ClosingDate groovy")
}
My expectation is to stop after the 4th execution but it goes on.... Attached screen shot shows the test case structure.
I am thinking it could be a defect .... I might be wrong
It is workig well but the execution would not stop.
def incrementValue = context.expand( '${#TestCase#incrementValue}' )
Below is the one for incremental value:
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+"")
//log.info incrementValue
Below is the script to run it in iterations:
import com.eviware.soapui.model.testsuite.TestStepResult.TestStepStatus
for( i in 1..4 )
{
testRunner.gotoStepByName( "ClosingDate groovy")
testRunner.runTestStepByName( "ClosingDate groovy")
}
My expectation is to stop after the 4th execution but it goes on.... Attached screen shot shows the test case structure.
I am thinking it could be a defect .... I might be wrong