[Webtest] How do I deal with recirection? - "Redirect requested but followRedirects is disabled"

Chris Gerrard webtest@lists.canoo.com
Fri, 14 Apr 2006 19:51:06 -0400


Hi,

I'm trying to write some tests for an application my company is 
developing for the local civic government.
Our app is hosted in the gov.'s environment. Login is handled by 
redirecting to their login page, to which the username and password are 
sent, and which in turn redirects back to our app upon authentication.

I got the first bit of the test working, contacting our app's URL and 
then seeing the login page.

Putting values into the userName and password files, and invoking 
clickButton sends the test off on a seemingly unending round of trying 
to access something.
At this point I don't know what's going on, am at a loss and wonder if 
there's any help.

My test steps are below, along with the first couple of iterations of 
the output generated after clickButton.

Apparently the verifyTitle step never gets invoked.

I've googled and looked around as best I can, but have been able to find 
nothing that points me down the right path.

Thanks in advance,

Chris Gerrard



<steps>
    <invoke  description="Try contacting WEPS"
             url="wepsmain.aspx"
             />
    <verifyTitle description="we should see the ... login page title"
                 text="..."
                 />
    <setInputField description="set userName"
                   name="userName"
                   value="..." />
    <setInputField description="set password"
                   name="password"
                   value="..." />
    <clickButton description="Click the submit button"
                 label="Submit" />
    <verifyTitle description="... Main Page shows if login is successful"
                 text="..." />
</steps>

[clickButton]  INFO (com.canoo.webtest.steps.Step) - >>>> Start Step: 
clickButton "Click the submit button" (5/6)
[clickButton]  INFO 
(com.canoo.webtest.steps.request.AbstractTargetAction) - -> gotoTarget 
by clickButton with name: null
[clickButton]  INFO (com.canoo.webtest.steps.request.ClickButton) - -> 
findTarget(by input): name=B1 value=Submit
[clickButton]  INFO (org.apache.commons.httpclient.HttpMethodBase) - 
Discarding unexpected response: HTTP/1.1 100 Continue
[clickButton]  INFO (org.apache.commons.httpclient.HttpMethodDirector) - 
Redirect requested but followRedirects is disabled
[clickButton]  WARN (com.gargoylesoftware.htmlunit.html.HtmlPage) - 
Expected content type of text/javascript or application/x-javascript for 
remotely loaded javascript element 
http://www.dc.gov/vincludes/global.asp but got [text/html]
[clickButton]  INFO 
(com.gargoylesoftware.htmlunit.javascript.host.Document) - Added cookie: 
DC=counter:2
[clickButton]  INFO (org.apache.commons.httpclient.HttpMethodBase) - 
Discarding unexpected response: HTTP/1.1 100 Continue
[clickButton]  INFO (org.apache.commons.httpclient.HttpMethodDirector) - 
Redirect requested but followRedirects is disabled
[clickButton]  INFO (org.apache.commons.httpclient.HttpMethodDirector) - 
Redirect requested but followRedirects is disabled
[clickButton]  WARN (com.gargoylesoftware.htmlunit.html.HtmlPage) - 
Expected content type of text/javascript or application/x-javascript for 
remotely loaded javascript element 
http://www.dc.gov/vincludes/global.asp but got [text/html]