[Webtest] problem with redirect after button invocation
Fri, 16 Jul 2004 15:50:51 +0200
thanx a lot for the tip with the debug level. I was looking for this =
but haven't found it...
the debug output helped me to find the problem. it's a bit tricky and =
nothing to do with webtest itself. for geeks: see explanation below
the problem lied in the com.meterware.httpunit.WebRequest-class of the
private String stripDoubleSlashes( String url )
normalizes URLs by collapsing // into /.=20
the url that webtest got by 302-redirect looked like:
this url was transformed to
which of course caused the 404...
after patching the WebRequest-class it works fine.
> -----Urspr=FCngliche Nachricht-----
> Von: firstname.lastname@example.org=20
> [mailto:email@example.com] Im Auftrag von Marc Guillemot
> Gesendet: Freitag, 16. Juli 2004 12:01
> An: firstname.lastname@example.org
> Betreff: Re: [Webtest] problem with redirect after button invocation
> Try setting the log level to debug in the=20
> WEBTEST_HOME/lib/log4j.properties, you will see a bit more=20
> what is working.
> Page not found means return code 404 and not 302. May it be=20
> that the page to which the server want to redirect with a
> 302 doesn't exist?
> Luca Scheuring wrote:
> > hello webtest community
> > here my test scenario:
> > - invocation of a http location
> > - server sends redirect (302) to a https location which contains a=20
> > login-form
> > - webtest follows redirect and switches properly to https protocol
> > - webtest fills out the form values and invokes the login button
> > - server sends back (still using https) a redirect (302) to a http=20
> > location (I know this from the webserver log-file)
> > - webtest switches the protocol back to http and accesses=20
> the new http=20
> > location (this step fails)
> > problem:
> > it seems that webtest can't handle the redirect which is received=20
> > after the button invocation. since this works fine using=20
> only http (no=20
> > https), I guess the problem is the redirect to a http-site=20
> as a result=20
> > of a button invocation when using https before.
> > this is the message I get:
> > Test step clickbutton named "Click the submit button" failed with=20
> > message "Step "clickbutton "Click the submit button" (6/7):=20
> Page not=20
> > found : click button"
> > in general, switching between http and https released by redirects=20
> > seems to work fine in both directions.
> > I know that my scenario might be a bit unusual but it's the way the=20
> > website that I want to test works.
> > did anybody encounter this problem or does have an idea what I am=20
> > doing wrong? (see my ant script below)
> > thanx,
> > --luca
> > -------------------------------------------
> > <target name=3D"login">
> > <testSpec name=3D"login" >
> > <config
> > host=3D"myhost"
> > port=3D"80"
> > protocol=3D"http"
> > basepath=3D"/"
> > saveresponse=3D"true"
> > verbose=3D"true"
> > summary=3D"true"
> > resultfile=3D"debug.xml"
> > showhtmlparseroutput=3D"true"
> > >
> > </config>
> > <steps>
> > <invoke
> > stepid=3D"goto login page"
> > url=3D"login.html" />
> > <verifytitle stepid=3D"check login"
> > text=3D"Login" />
> > <setinputfield stepid=3D"set user name"=20
> > name=3D"credential_0"
> > value=3D"username" />
> > <setinputfield stepid=3D"set password"=20
> > name=3D"credential_1"
> > value=3D"*******" />
> > <clickbutton =20
> > label=3D"Go"
> > stepid=3D"Click the submit button" />
> > </steps>
> > </testSpec>
> > </target>
> > _______________________________________________
> > WebTest mailing list
> > WebTest@lists.canoo.com
> > http://lists.canoo.com/mailman/listinfo/webtest
> WebTest mailing list