cancel
Showing results for 
Search instead for 
Did you mean: 

Setting 'Follow Redirects' to true causes connection refused exception

SOLVED
Highlighted
Contributor

Setting 'Follow Redirects' to true causes connection refused exception

In writing a test case for a login scenario, there are many redirects that take place. For some reason, whenever I set the Follow Redirects test case option to true, I get the following exception without fail:

 

ERROR:Exception in request: org.apache.http.conn.HttpHostConnectException: Connect to 10.111.222.333:80 [/10.111.222.333] failed: Connection refused: connect

 

I am not using a proxy. There is a workaround, but it's pretty cumbersome -- I can turn this option to false, then using a Groovy script, extract the URL where it is supposed to redirect, then set that as the service of the next REST request. Has anyone else experienced this? Is this a bug? It's pretty inconvenient to have all this Groovy code in between requests that redirect.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Moderator

Re: Setting 'Follow Redirects' to true causes connection refused exception

Hi Justin!

 

Thank you for your post. What version of Ready! API do you use? Since Ready! API 2.0.0 we have two options to handle redirects: 

Follow Redirects

If true, the request will follow the redirect and return the server message. Otherwise, a redirect message will be returned.

Follow 302 Redirect with GET

If true, Ready! API uses the GET method for subsequent requests if the response has the 302 Found HTTP code.

 

Did you try both?

If you don't use the latest version, please upgrade Ready! API to the latest one and try again. You can download the latest release of Ready! API from here: https://support.smartbear.com/downloads/readyapi/


Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️

View solution in original post

2 REPLIES 2
Highlighted
Moderator

Re: Setting 'Follow Redirects' to true causes connection refused exception

Hi Justin!

 

Thank you for your post. What version of Ready! API do you use? Since Ready! API 2.0.0 we have two options to handle redirects: 

Follow Redirects

If true, the request will follow the redirect and return the server message. Otherwise, a redirect message will be returned.

Follow 302 Redirect with GET

If true, Ready! API uses the GET method for subsequent requests if the response has the 302 Found HTTP code.

 

Did you try both?

If you don't use the latest version, please upgrade Ready! API to the latest one and try again. You can download the latest release of Ready! API from here: https://support.smartbear.com/downloads/readyapi/


Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️

View solution in original post

Highlighted
Contributor

Re: Setting 'Follow Redirects' to true causes connection refused exception

Looks like this was actually a problem on our end. We structured our login test case a bit differently and it's working (and following redirects)

New Here?
Join us and watch the welcome video:
Announcements
Script Wanted
Let's start July with new challenges!

Create a script to change request body before sending it to the server for the TechCorner tag!


Scripts created in June:
- A script to generate a request body based on data from Datasource
- A script to go through all response nodes and check the value of the required field
- A Dispatching script to get responses based on the values in Request Body
- A script to add a new tag and assign it to all TestCases in a TestSuite
Top Kudoed Authors