[Webtest] RE: problem with NT authentication

Michael Dunn webtest@lists.canoo.com
Wed, 12 Apr 2006 14:03:41 -0700


marc,

I must admit that I am new to debugging this java stuff, so I do not
understand your instructions: "You can launch by yourself
org.apache.tools.ant.Main with your test file name as argument and start
it in debug mode." if you could give more explicit instructions for this
or point me to documentation, I could give it a try, if need be.

what I did do was re-run the test and I have included the complete test
section and some of the debug output from the run. I have replaced the
username and password with placeholders. you were correct, the
DefaultCredentialsProvider does seem to return the correct credentials,
but the page still fails.
just for clarification, if I enter this URL into my browser(IE 6.0), I
do get the correct page to come up.

later,
mikey


ok here is the webtest section:
    <target name=3D"testMassTrans">
        <testSpec name=3D"Mass Transition all entries assigned to =
Config">
            &config;
            <steps>
                <invoke=20
                    username=3D"*myusername*"
                    password=3D"*password*"  =20
                    description=3D"get mass trans report, pass in logon
info"=20
=20
url=3D"tmtrack.dll?ReportPage&amp;Template=3Dreports%2Flist&amp;reportid=3D=
53"
/> =20
                <verifyText=20
                    description=3D"Should see title of report on page"=20
                    text=3D"mytestmass" />
                <clickLink=20
                    description=3D"Click the Check All link"=20
                    label=3D"Check All" />
                <verifyCheckbox=20
                    description=3D"Verify that option is selected"
                    name=3D"SelectId"
                    checked=3D"true"/>
                <verifyText=20
                    description=3D"Should see title of report on page"=20
                    text=3D"mytestmass" />
                <clickButton=20
                    description=3D"Click the Update All button"=20
                    label=3D"Update All Checked" />
                <verifyText=20
                    description=3D"Should see title of report on page"=20
                    text=3D"Release to Test" />

            </steps>
        </testSpec>   =20
    </target>=20

the &config; calls the following file:
<config=20
    host=3D"${web.server}"
    port=3D"${webtest.port}"
    protocol=3D"${webtest.protocol}"
    basepath=3D"${webtest.base.path}"=20
    summary=3D"${webtest.summary}"
    saveresponse=3D"${webtest.save.response}"
    resultpath=3D"${webtest.result.path}"
    resultfile=3D"${webtest.result.file}"
    showhtmlparseroutput=3D"${webtest.show.html.parser.output}"
    haltonfailure=3D"${webtest.halt.on.failure}"
    />

the partial debug output follows. I have shortenend it as the first time
I sent everything and it was rejected from the maillist as being too
big:

testMassTrans:
...
<more output>
...
DEBUG (com.canoo.webtest.engine.Engine) - Executing steps...
DEBUG (com.canoo.webtest.engine.Engine) - Executing step InvokePage at
C:\projects\Projects\Boxcar\main\src\test\webtest\test\talus\test_teamtr
ack.xml:70:  with (password=3D"*password*", description=3D"get mass =
trans
report, pass in logon info", username=3D"*myusername*",
url=3D"tmtrack.dll?ReportPage&Template=3Dreports%2Flist&reportid=3D53",
method=3D"GET", stepType=3D"invoke")
...
<more output>
...
   [invoke] INFO (com.canoo.webtest.steps.request.TargetHelper) -
Setting password for username: *myusername*
   [invoke] DEBUG
(com.gargoylesoftware.htmlunit.DefaultCredentialsProvider) - Flushed
marked answers
   [invoke] DEBUG (com.gargoylesoftware.htmlunit.WebClient) - Get page
for window named '', using
WebRequestSettings[<url=3D"http://ts09utl/tmtrack/tmtrack.dll?ReportPage&=
T
emplate=3Dreports%2Flist&reportid=3D53", SubmitMethod[name=3Dget],
EncodingType[name=3Dapplication/x-www-form-urlencoded], [], {}, null>]
...
<more output>
...
   [invoke] DEBUG
(org.apache.commons.httpclient.params.DefaultHttpParams) - Set parameter
http.authentication.credential-provider =3D
com.gargoylesoftware.htmlunit.DefaultCredentialsProvider@c01e99
   [invoke] DEBUG (org.apache.commons.httpclient.methods.GetMethod) -
enter GetMethod(String)
   [invoke] DEBUG
(org.apache.commons.httpclient.params.DefaultHttpParams) - Set parameter
http.method.retry-handler =3D
com.gargoylesoftware.htmlunit.HttpWebConnection$1@13936e1
   [invoke] DEBUG (org.apache.commons.httpclient.HttpClient) - enter
HttpClient.executeMethod(HostConfiguration,HttpMethod)
   [invoke] DEBUG (org.apache.commons.httpclient.HttpClient) - enter
HttpClient.executeMethod(HostConfiguration,HttpMethod,HttpState)
   [invoke] DEBUG (org.apache.commons.httpclient.HttpMethodDirector) -
Attempt number 1 to process request
   [invoke] DEBUG (org.apache.commons.httpclient.HttpConnection) - enter
HttpConnection.open()
   [invoke] DEBUG (org.apache.commons.httpclient.HttpConnection) - Open
connection to ts09utl:80
   [invoke] DEBUG (org.apache.commons.httpclient.HttpMethodBase) - enter
HttpMethodBase.execute(HttpState, HttpConnection)
...
<more output>
...
   [invoke] DEBUG (org.apache.commons.httpclient.HttpMethodDirector) -
Authorization required
   [invoke] DEBUG (org.apache.commons.httpclient.HttpMethodDirector) -
enter HttpMethodBase.processAuthenticationResponse(HttpState,
HttpConnection)
   [invoke] DEBUG
(org.apache.commons.httpclient.auth.AuthChallengeProcessor) - Supported
authentication schemes in the order of preference: [ntlm, digest, basic]
   [invoke] INFO
(org.apache.commons.httpclient.auth.AuthChallengeProcessor) - ntlm
authentication scheme selected
   [invoke] DEBUG
(org.apache.commons.httpclient.auth.AuthChallengeProcessor) - Using
authentication scheme: ntlm
   [invoke] DEBUG
(org.apache.commons.httpclient.auth.AuthChallengeProcessor) -
Authorization challenge processed
   [invoke] DEBUG (org.apache.commons.httpclient.HttpMethodDirector) -
Authentication scope: NTLM <any realm>@ts09utl:80
   [invoke] DEBUG (org.apache.commons.httpclient.HttpState) - enter
HttpState.getCredentials(AuthScope)
   [invoke] DEBUG (org.apache.commons.httpclient.HttpMethodDirector) -
Credentials required
   [invoke] DEBUG
(com.gargoylesoftware.htmlunit.DefaultCredentialsProvider) - Returning
*myusername*:*password* for ntlm null ts09utl:80 false
   [invoke] DEBUG (org.apache.commons.httpclient.HttpState) - enter
HttpState.setCredentials(AuthScope, Credentials)
   [invoke] DEBUG (org.apache.commons.httpclient.HttpMethodDirector) -
NTLM <any realm>@ts09utl:80 new credentials given
   [invoke] DEBUG (org.apache.commons.httpclient.HttpMethodDirector) -
Retry authentication
   [invoke] DEBUG (httpclient.wire.content) - << "<!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 3.2 Final//EN">[\r][\n]"
   [invoke] DEBUG (httpclient.wire.content) - << "<html
dir=3Dltr>[\r][\n]"
   [invoke] DEBUG (httpclient.wire.content) - << "[\r][\n]"
   [invoke] DEBUG (httpclient.wire.content) - << "<head>[\r][\n]"
   [invoke] DEBUG (httpclient.wire.content) - << "<style>[\r][\n]"
   [invoke] DEBUG (httpclient.wire.content) - << "a:link
{font:8pt/11pt verdana; color:FF0000}[\r][\n]"
   [invoke] DEBUG (httpclient.wire.content) - << "a:visited
{font:8pt/11pt verdana; color:#4e4e4e}[\r][\n]"
   [invoke] DEBUG (httpclient.wire.content) - << "</style>[\r][\n]"
   [invoke] DEBUG (httpclient.wire.content) - << "[\r][\n]"
   [invoke] DEBUG (httpclient.wire.content) - << "<META NAME=3D"ROBOTS"
CONTENT=3D"NOINDEX">[\r][\n]"
   [invoke] DEBUG (httpclient.wire.content) - << "[\r][\n]"
   [invoke] DEBUG (httpclient.wire.content) - << "<title>You are not
authorized to view this page</title>[\r][\n]"
...
<more output, then it tries again without credentials>
...
BUILD FAILED
C:\projects\Projects\Boxcar\main\src\test\webtest\test\talus\test_teamtr
ack.xml:63: Canoo Webtest: R_1217.
Test failed.
Test step invoke
(C:\projects\Projects\Boxcar\main\src\test\webtest\test\talus\test_teamt
rack.xml:70: )  named "get mass trans report, pass in logon info" failed
with message "Step[invoke "get mass trans report, pass in logon info"
(1/7)]: HTTP error 401, at: invoke"

Total time: 5 seconds


Michael Dunn=20
Product Test Manager=20
Adaptis=20
206 342 7478=20


-----Original Message-----
From: webtest-admin@lists.canoo.com
[mailto:webtest-admin@lists.canoo.com] On Behalf Of Marc Guillemot
Sent: Friday, April 07, 2006 6:45 AM
To: webtest@lists.canoo.com
Subject: [Webtest] RE: problem with NT authentication


Hi Michael,

how does your webtest look like? Is the invoke with username & password
at the first position? It seems to me that a message from the
DefaultCredentialsProvider is missing. It should have happened before
what you've sent.

You can launch by yourself org.apache.tools.ant.Main with your test file
name as argument and start it in debug mode. This will allow you to set
breakpoint in webtest/htmlunit/commons-httpclient (in this case it is
recommanded to download the sources as well).

Marc.
--
View this message in context:
http://www.nabble.com/problem-with-NT-authentication-t1408026.html#a3803
833
Sent from the WebTest forum at Nabble.com.

_______________________________________________
WebTest mailing list
WebTest@lists.canoo.com
http://lists.canoo.com/mailman/listinfo/webtest