Forum Discussion
rohitgkk
13 years agoContributor
Hi.
Ok, Then follow the following steps:
Step 1: Create a soapUI project and test suite and a test case within the test suite.
Step 2: Create a property at test case level say "incrementValue" and assign some value say 1
Step 3: Now add your Request say "Request 1" in this request add ${#TestCase#incrementValue} to the input element in the request.
So that it will take the value from the property that you have created at test case level i.e. incrementValue
Step 4: Now add Groovy step after the step "Request 1". Then add the following code in that
def incrementValue = context.expand( '${#TestCase#IncrementValue}' );
incrementValue = incrementValue.toInteger() + 1;
if (incrementValue <= 10) {
testRunner.testCase.setPropertyValue("IncrementValue", incrementValue);
log.info "IncrementValue: "+incrementValue;
testRunner.gotoStepByName("Request 1");
}
Step 5: Double click on the test case level and Test case editor will be displayed click on green button.
That's it!!!!!!!
Your request will be executed 10 times as per the groovy. Please remember to mention this otherwise it will run infinite times causing memory outage.
Hope this helps!!
Regards,
Rohit Shingalapur
http://rohit-developerscorner.blogspot.com/
Ok, Then follow the following steps:
Step 1: Create a soapUI project and test suite and a test case within the test suite.
Step 2: Create a property at test case level say "incrementValue" and assign some value say 1
Step 3: Now add your Request say "Request 1" in this request add ${#TestCase#incrementValue} to the input element in the request.
So that it will take the value from the property that you have created at test case level i.e. incrementValue
Step 4: Now add Groovy step after the step "Request 1". Then add the following code in that
def incrementValue = context.expand( '${#TestCase#IncrementValue}' );
incrementValue = incrementValue.toInteger() + 1;
if (incrementValue <= 10) {
testRunner.testCase.setPropertyValue("IncrementValue", incrementValue);
log.info "IncrementValue: "+incrementValue;
testRunner.gotoStepByName("Request 1");
}
Step 5: Double click on the test case level and Test case editor will be displayed click on green button.
That's it!!!!!!!
Your request will be executed 10 times as per the groovy. Please remember to mention this otherwise it will run infinite times causing memory outage.
Hope this helps!!
Regards,
Rohit Shingalapur
http://rohit-developerscorner.blogspot.com/
Related Content
Recent Discussions
- 10 days agogos2610