Login | Register
My pages Projects Community openCollabNet

Discussions > dev > Re: [maxq-dev] Anyone working on fixing the follow redirects?

maxq
Discussion topic

Back to topic list

Re: [maxq-dev] Anyone working on fixing the follow redirects?

Author hdara at primavera dot com
Full name hdara at primavera dot com
Date 2004-07-22 15:57:31 PDT
Message Thanks for the response. But I don't understand why the browser behavior
should impact MaxQ. There may be some issue here with HTTP to HTTPS, but I
didn't know if MaxQ supports it. If not, any variation in browser behavior
will also be recorded, so won't be just fine to play it back?

Can anyone comment on the following TODO comment? What does "wmh" mean?


    public void doAssertResponse(String respCode) {
        StringBuffer result = new StringBuffer();
        result.append(create​Statement("print \"Response code: %s\" %
self.getMethod().get​StatusCode()"));
        //hack: wmh redirects have a timing issue that can cause assertion
failures
        if(!respCode.startsWith("302")) {
            result.append(create​Statement("self.asse​rtEquals(\"Assert
number " + ++assertNumber + " failed\", " + respCode +
                ", self.getMethod().get​StatusCode())"));
        }
        result.append(create​Statement("Validator​.validateResponse(se​lf,
self.getMethod(), self.currentUrl, self.currentParams)"));
        getScriptAdapter().a​ppend(result.toStrin​g());
    }

I am thinking that recording both the original request with the 302
response code followed by the redirection request should work. Since
HttpClient doesn't automatically handle redirects, it should play back
fine. An additional check to make sure that the original redirection URL
and the new one from the redirect response are same will be good. I will
really appreciate any comments on this.

Thank you,
Hari

Frank Cohen <fcohen at pushtotest dot com> wrote on 07/22/2004 11:29:04 AM:

> Browsers handle HTTP redirects differently, especially when the
> redirect goes from an HTTP to HTTPS connection. TestMaker uses the
> HTTPUrlConnection class in Java and I've been thinking about creating a
> browser profile to control how redirects are processed. I haven't
> gotten very far on it. -Frank
>
>
>
>
> On Jul 22, 2004, at 11:20 AM, hdara at primavera dot com wrote:
>
> > Currently the follow redirects are not recorded and are disabled at
> > runtime. This causes a serious limitation for us, because, unless
> > certain
> > URLs are accessed, the resources on the server are not created, so the
> > subsequent requests on the resource will fail. I would like to get
this
> > fixed, but if someone is already working on it, I would like to work
> > with
> > them to avoid duplicating the effort.
> >
> > Also I am not very much sure why recording of redirects was disabled.
I
> > think I saw somewhere in the code a FIXME with an explicit disable of
> > this. All I can think of was that the old HTTPClient library didn't
> > provide control to the programmer on how the redirects should be
> > handled,
> > so recording them resulted in duplicate requests and even worse,
> > incorrect
> > status codes. If commons HttpClient has better control on handling
> > redirects, is it not easy enough to enable this part of the code
> > again? I
> > will be very much interested to here any thoughts from those who knew
> > the
> > original problem and has ideas on how to get it working with the new
> > library.
> >
> > I think this change will break the old scripts, so we will probably
> > have
> > to encode this information in the script (like an explicit call to
> > enable
> > the feature).
> >
> > Thank you,
> > Hari
> >
> > --------------------​--------------------​--------------------​---------
> > To unsubscribe, e-mail: dev-unsubscribe at maxq dot tigris dot org
> > For additional commands, e-mail: dev-help at maxq dot tigris dot org
> >
> >
> ---
> Frank Cohen, PushToTest, http://www.PushToTest.com, phone: 408 374 7426
> Author of "Java Testing and Design: From Unit Tests to Automated Web
> Tests"
> from Prentice Hall, details at http://thebook.pushtotest.com
>
>
> --------------------​--------------------​--------------------​---------
> To unsubscribe, e-mail: dev-unsubscribe at maxq dot tigris dot org
> For additional commands, e-mail: dev-help at maxq dot tigris dot org
>


--------------------​--------------------​--------------------​---------
To unsubscribe, e-mail: dev-unsubscribe at maxq dot tigris dot org
For additional commands, e-mail: dev-help at maxq dot tigris dot org

« Previous message in topic | 3 of 6 | Next message in topic »

Messages

Show all messages in topic

[maxq-dev] Anyone working on fixing the follow redirects? hdara at primavera dot com hdara at primavera dot com 2004-07-22 11:20:07 PDT
     Re: [maxq-dev] Anyone working on fixing the follow redirects? fcohen Frank Cohen 2004-07-22 11:29:04 PDT
         Re: [maxq-dev] Anyone working on fixing the follow redirects? hdara at primavera dot com hdara at primavera dot com 2004-07-22 15:57:31 PDT
             Re: [maxq-dev] Anyone working on fixing the follow redirects? hdara at primavera dot com hdara at primavera dot com 2004-07-23 12:40:12 PDT
                 Re: [maxq-dev] Anyone working on fixing the follow redirects? henrik dot westman at uk dot bnpparibas dot com henrik dot westman at uk dot bnpparibas dot com 2004-07-26 00:49:07 PDT
                     Re: [maxq-dev] Anyone working on fixing the follow redirects? hdara at primavera dot com hdara at primavera dot com 2004-07-26 10:16:54 PDT
Messages per page: