This is a migrated thread and some comments may be shown as answers.

Should 'Run Step' update the Last Response Data?

2 Answers 80 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Stan
Top achievements
Rank 1
Stan asked on 31 Mar 2017, 06:34 PM

Hello,

I have a test step that requests a page from our web application. The request is a GET for host/instance/Dashboard, and receives the following response:

----------

HTTP/1.1 302 Found
Cache-Control: private
Content-Type: text/html; charset=utf-8
Location: /instance/?Redirect=%252finstance%252fDashboard
Server: Microsoft-IIS/8.5
X-AspNetMvc-Version: 5.2
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Fri, 31 Mar 2017 18:19:53 GMT
Content-Length: 160

<html><head><title>Object moved</title></head><body>
<h2>Object moved to <a href="/instance/?Redirect=%252finstance%252fDashboard">here</a>.</h2>
</body></html>

----------

The step would normally successfully go to our 'Dashboard', but in this case I am executing the step without being logged in, which is why I am being redirected. The problem is that the Last Response Data section never gets updated with the 302 Found response - it still contains the response from a previous run where the actual requested document was returned. Should the Last Response Data update when you execute an individual step?

Thanks in advance.

2 Answers, 1 is accepted

Sort by
0
Stan
Top achievements
Rank 1
answered on 31 Mar 2017, 06:49 PM

Hello,

I may understand what's happening now - upon further inspection, it looks like the Last Response Data contains the document resulting from the redirect which occurred as a result of the 302 Found response. Since I expected to see the 302 response, I couldn't tell that the Last Response Data actually had changed - the html at the beginning of the document is identical to that of the previous document.

I thought the 302 Found would be the response that I ran verification against, but I guess I don't get that opportunity.

I don't think that's a big problem, it was just a little surprising. If you have something to add about how we might do verification that we ended up on the page we requested, I'd like to hear it.

Thanks!

0
Accepted
Elena
Telerik team
answered on 05 Apr 2017, 02:32 PM
Hi Stan,

Thank you for your interest in Telerik Test Studio. 

The reason for the reported behavior is that the request redirects you to another page. By default the Follow Redirects under Settings tab is set to true (please refer to the screenshot). That means the default behavior is to automatically execute the request based on the redirect response. 

However if you would like to verify that the request was successfully called you could uncheck the checkbox to get the 302 response. To execute the redirect request it will be required to set a variable extracting the Location from the initial request response. Then use it in a new http request step to execute the redirected query. 

I hope this will be helpful to you to better build your tests. In case of further questions do not hesitate to contact us again! 

Regards,
Elena Tsvetkova
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Stan
Top achievements
Rank 1
Answers by
Stan
Top achievements
Rank 1
Elena
Telerik team
Share this question
or