Ask a Question

Read Timed out

SOLVED
Sritharan
Occasional Contributor

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 

4 REPLIES 4
ChrisAdams
Community Leader

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.

 

Screenshot 2021-10-01 085215.png

 

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

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?

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.  

Sritharan
Occasional Contributor

Setting the connection header manually, override the default headers. So if anyone wanted to change header for just one request, it is possible

 

Thanks for the reply, chris

I am going to keep the connection closed for all the api's. Hope it does not affect other api behaviors

cancel
Showing results for 
Search instead for 
Did you mean: