jsreesoap
11 years agoContributor
How to use sleep or delay in a loop
Hi
How do I make sure the test step is executed before it goes to next round of execution in executing test case in iterations?
In my test case I have 10 iterations to run 2 test steps. The second test step creates a unique value and writes to database. The code I am testing verifies the value that it creates and throws an exception if my script tries to creates the same value.
When I executed the test case some times it works but sometimes it fails since SoapUi is trying to run the test step without refreshing property values that are used as input.
For example ' "offerName":"ExemptOffer-K4018", here the offer name should be changed based on
Random r = new Random(System.currentTimeMillis());
String number = "";
for(int j=0; j < 4; j++) {
number +=Integer.toString(r.nextInt(9));
}
def exmType = context.expand( '${#TestSuite#ExmType}' )
testRunner.testCase.testSuite.setPropertyValue("offerName", "ExemptOffer-" + exmType +number)
log.info "number" + number
script. I see the number is changing in log but not in my script.
How do I put a check to make sure it goes to next iteration only when the running iteration is done?
Thanks
How do I make sure the test step is executed before it goes to next round of execution in executing test case in iterations?
In my test case I have 10 iterations to run 2 test steps. The second test step creates a unique value and writes to database. The code I am testing verifies the value that it creates and throws an exception if my script tries to creates the same value.
When I executed the test case some times it works but sometimes it fails since SoapUi is trying to run the test step without refreshing property values that are used as input.
For example ' "offerName":"ExemptOffer-K4018", here the offer name should be changed based on
Random r = new Random(System.currentTimeMillis());
String number = "";
for(int j=0; j < 4; j++) {
number +=Integer.toString(r.nextInt(9));
}
def exmType = context.expand( '${#TestSuite#ExmType}' )
testRunner.testCase.testSuite.setPropertyValue("offerName", "ExemptOffer-" + exmType +number)
log.info "number" + number
script. I see the number is changing in log but not in my script.
How do I put a check to make sure it goes to next iteration only when the running iteration is done?
Thanks