groovy-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Deng, Lea" <>
Subject catch Read timed out and retry
Date Wed, 13 Jul 2016 22:58:48 GMT
Hello community,
I'd like to get your suggestions on handling java.netSocketTimeoutException.
The tests are in Ready! API. Test steps are:

1.       Read out data excel sheet and put data in Ready! API's Data Source

2.       Using the data above, request for a report from local server

3.       Groovy script to further process in the information from the report returned in Step

Yesterday, my PC and network seemed to very slow. I got about 3 out of 5 "java.netSocketTimeoutException:
Read timed out" for Step 2.

I was trying to catch this exception and retry Step 2.

I tried adding a small groovy script between Step 1 and Step 2 doing these jobs:

Run step 2}

Catch (java.netSocketTimeoutExeception e){
Run step 2

This approach didn't work. And by doing this, Step 2 is done twice in the Try {}, and then
again in Step 2.

I was also thinking to make Step 3 throw an exception if an exception does occurs, and I can
catch it between Step 2 and Step 3. But I haven't got time to try this approach.

Any suggestions are appreciated.
Many thanks,

Kind Regards
Lea Deng

This electronic email and any files transmitted with it are intended
solely for the use of the individual or entity to whom they are addressed.

The views expressed in this message are those of the individual sender
and may not necessarily reflect the views of the Christchurch City Council.

If you are not the correct recipient of this email please advise the
sender and delete.

Christchurch City Council

View raw message