Forum Discussion
SmartBear_Suppo
Alumni
14 years ago
smartTest wrote: If... the preceeding response step
Contains String...... HTTP response
Then
timesRetried = 0
previousResponse = testRunner.testCase.getTestStepByName( 'Name Of Preceeding TestStep' ).testRequest.response.contentAsString
if( previousResponse.contains('HTTP response') )
{
smartTest wrote: GoTo the preceeding resopnse step and try again, To a maximum of 'X' times
if ( timesRetried++ <= x )
testRunner.gotoStepByName( 'Name Of Preceeding TestStep' )
}
Something along those lines. Note that the code is not actually using the logical preceeding TestStep, but a hardcoded name of a TestStep. I left this out for simplicity.
When I write code like this, I find the soapUI API very useful.
Hope this gets you in the right direction!
Henrik
SmartBear Software