Auto retry SOAP request on timeout
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Auto retry SOAP request on timeout
How can I get SOAP UI to resend a SOAP request (test step) automatically if it times out?
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Does the response come back with some kind of message content? You can write a Groovy script to retry the test case if the response contains a particular message or code if this is the case?
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No - unfortunately I get a java socket timeout exception:
Error getting response; java.net.SocketTimeoutException: Read timed out
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Sorry to drop in Mike, but as well as a Groovy option (which could still work e.g. if you set a successfulResponse property in a script Assertion based on the proper response being received and loop if this is false), have you considered the Conditional Goto TestStep:
http://www.soapui.org/functional-testing/teststep-reference/conditional-goto/conditional-goto.html
You could maybe use a boolean XPath expression to loop if an element of a proper response is not found:
http://stackoverflow.com/questions/1887077/returning-a-boolean-from-an-xpath-expression
Just another option maybe thats more out-of-the-box?
Cheers,
Rup
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Rup,
I've had a go with these approaches. Unfortunately conditional goto refuses to work if there's no response.
I've been trying to see if I can use Groovy to get at the test step result and see if there was an exception. Unforunately, whilst I can get the result object with testRunner.getResults(), and I can see the status is 'FAILED', the error property is null, so I can't see whether it's a timeout or some other kind of error.
Any ideas?
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Ok, thats a shame about the Conditional Goto TestStep not working.
Ok, are you seeing any particular response data when the request has timed out? Is it null?
I did wonder if you could test the response and set a flag (some kind of property e.g. at TestCase or context level) in a Script Assertion when making the request e.g. something like:
if (messageExchange.response.contentAsString==null or is empty) set property successfulResponse=false
And then check the flag and loop if false e.g. have a Groovy TestStep with
if (successfulResponse) testRunner.gotoStepByName( "Request TestStep Name" )
I guess its really a a case of working out how to detect the timeout?
Cheers,
Rup
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I realize this post is a bit old but I am wondering if a solution was found here? I am running into the same issue and looking for a reliable solution.
Thanks!
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Regards,
Rao.
