Forum Discussion

Sritharan's avatar
Sritharan
Occasional Contributor
4 years ago

Read Timed out

Hi All,

 

I created a test case with the following test steps in readyAPI

 

1) Generate an access token

2) User access token generated in the previous step and get customer account details (We have to pass this token as a header (Bearer))

3) Delete the access token

4) Now using the same token, i am trying to get the customer details again

 

Expected Result : 401 unauthorized

Actual Result: Read timed out

 

When i run these 4 steps, one by one , i am able to achieve the expected results. But when i run the test case as a whole, 4th step gets read timed out

I tried to mimic the same behavior in Postman, and i am able to run it successfully there. Kindly advise 

  • Hi,

     

    Not sure if this helps, but it sounds like the connection is kept open somehow.

     

    If preferences, you can force SoapUI to close connections after each request.

     

     

    Maybe this will ensure a fresh connection is built without the deleted access token.

  • ChrisAdams's avatar
    ChrisAdams
    Champion Level 3

    Hi,

     

    Not sure if this helps, but it sounds like the connection is kept open somehow.

     

    If preferences, you can force SoapUI to close connections after each request.

     

     

    Maybe this will ensure a fresh connection is built without the deleted access token.

    • Sritharan's avatar
      Sritharan
      Occasional Contributor

      Wow, that works!. Thanks for the timely help

      But i want to understand this functionality. Can you explain this. Since we are setting the preference at a global level, will it affect my other test cases ?

       

      Also i saw the raw-request, and i saw this header parameter "Connection":"Close. By default, since we are using HTTP 1.1, we were seeing "Connection": Keep-Alive. So, if we set a header parameter connection manually, will it over ride the Connection set by ReadyAPI?

      • ChrisAdams's avatar
        ChrisAdams
        Champion Level 3

        Since we are setting the preference at a global level, will it affect my other test cases ?  I suppose that depends on exactly what you're testing.  My default is close connection.  I have some tests where the API demands authentication and others that don't.  I suppose those with authentication have to re-authenticate each time instead of "authenticate once and use many".  Luckily, it is a global config and if other tests break, then re-enable, which I suppose leads nicely onto your next question.

         

        Also i saw the raw-request, and i saw this header parameter "Connection":"Close. By default, since we are using HTTP 1.1, we were seeing "Connection": Keep-Alive. So, if we set a header parameter connection manually, will it over ride the Connection set by ReadyAPI?  Not sure, but that would a be neat little test to try.