You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Be...@ucb.com on 2009/09/10 18:00:33 UTC

Missing cookie

Hi,

I try to use JMeter (latest version) with a website built with Spring-Security where user authentication is managed by NTLM.

When JMeter requests the URL, the server answers that it is waiting an NTLM authentication.
In its response, the server provides also cookie with the JSESSION id.
When JMeter answers with the NTLM authentication, the JSESSION cookie is missing.
Why?

Here are the headers:

***************
GET /ScoobyDoo/home.htm HTTP/1.1
Connection: keep-alive
Authorization: Basic RTExODYxNjppcmxhMjAwOQ==
User-Agent: Java/1.6.0_10
Host: 10.1.38.144
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2

HTTP/1.1 401 Unauthorized
Date: Thu, 10 Sep 2009 15:45:06 GMT
Server: Apache/2.2.11 (Win32) mod_jk/1.2.27 PHP/5.2.5
Set-Cookie: JSESSIONID=BE6CB49D5CA9B2E885A6540CDF4A50E3; Path=/ScoobyDoo
WWW-Authenticate: NTLM
Connection: Keep-Alive, Keep-Alive
Content-Length: 0
Keep-Alive: timeout=5, max=100
Content-Type: text/html

GET /ScoobyDoo/home.htm HTTP/1.1
Connection: keep-alive
Authorization: NTLM TlRMTVNTUAABAAAAB7IIoggACAAxAAAACQAJACgAAAAFASgKAAAAD0JFTDAwMTk4OFVDQi1DT1JQ
User-Agent: Java/1.6.0_10
Host: 10.1.38.144
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
***************

And here is my JMeter config:

*****************
<?xml version="1.0" encoding="UTF-8"?>
<jmeterTestPlan version="1.2" properties="2.1">
  <hashTree>
    <TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="DDR" enabled="true">
      <stringProp name="TestPlan.comments"></stringProp>
      <boolProp name="TestPlan.functional_mode">false</boolProp>
      <boolProp name="TestPlan.serialize_threadgroups">false</boolProp>
      <elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
        <collectionProp name="Arguments.arguments"/>
      </elementProp>
      <stringProp name="TestPlan.user_define_classpath"></stringProp>
    </TestPlan>
    <hashTree>
      <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Thread Group" enabled="true">
        <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
          <boolProp name="LoopController.continue_forever">false</boolProp>
          <stringProp name="LoopController.loops">2</stringProp>
        </elementProp>
        <stringProp name="ThreadGroup.num_threads">2</stringProp>
        <stringProp name="ThreadGroup.ramp_time">2</stringProp>
        <longProp name="ThreadGroup.start_time">1252584792000</longProp>
        <longProp name="ThreadGroup.end_time">1252584792000</longProp>
        <boolProp name="ThreadGroup.scheduler">false</boolProp>
        <stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
        <stringProp name="ThreadGroup.duration"></stringProp>
        <stringProp name="ThreadGroup.delay"></stringProp>
      </ThreadGroup>
      <hashTree>
        <AuthManager guiclass="AuthPanel" testclass="AuthManager" testname="HTTP Authorization Manager" enabled="true">
          <collectionProp name="AuthManager.auth_list">
            <elementProp name="" elementType="Authorization">
              <stringProp name="Authorization.url">http://10.1.38.144/</stringProp>
              <stringProp name="Authorization.username">E118616</stringProp>
              <stringProp name="Authorization.password">password</stringProp>
              <stringProp name="Authorization.domain">UCB-CORP</stringProp>
              <stringProp name="Authorization.realm"></stringProp>
            </elementProp>
          </collectionProp>
        </AuthManager>
        <hashTree/>
        <ConfigTestElement guiclass="HttpDefaultsGui" testclass="ConfigTestElement" testname="HTTP Request Defaults" enabled="true">
          <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
            <collectionProp name="Arguments.arguments"/>
          </elementProp>
          <stringProp name="HTTPSampler.domain">10.1.38.144</stringProp>
          <stringProp name="HTTPSampler.port"></stringProp>
          <stringProp name="HTTPSampler.connect_timeout"></stringProp>
          <stringProp name="HTTPSampler.response_timeout"></stringProp>
          <stringProp name="HTTPSampler.protocol"></stringProp>
          <stringProp name="HTTPSampler.contentEncoding"></stringProp>
          <stringProp name="HTTPSampler.path"></stringProp>
        </ConfigTestElement>
        <hashTree/>
        <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true">
          <collectionProp name="CookieManager.cookies"/>
          <boolProp name="CookieManager.clearEachIteration">false</boolProp>
        </CookieManager>
        <hashTree/>
        <HTTPSampler guiclass="HttpTestSampleGui" testclass="HTTPSampler" testname="AskMIKe Request" enabled="true">
          <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
            <collectionProp name="Arguments.arguments"/>
          </elementProp>
          <stringProp name="HTTPSampler.domain"></stringProp>
          <stringProp name="HTTPSampler.port"></stringProp>
          <stringProp name="HTTPSampler.connect_timeout"></stringProp>
          <stringProp name="HTTPSampler.response_timeout"></stringProp>
          <stringProp name="HTTPSampler.protocol"></stringProp>
          <stringProp name="HTTPSampler.contentEncoding"></stringProp>
          <stringProp name="HTTPSampler.path">ScoobyDoo/home.htm</stringProp>
          <stringProp name="HTTPSampler.method">GET</stringProp>
          <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
          <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
          <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
          <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
          <stringProp name="HTTPSampler.FILE_NAME"></stringProp>
          <stringProp name="HTTPSampler.FILE_FIELD"></stringProp>
          <stringProp name="HTTPSampler.mimetype"></stringProp>
          <boolProp name="HTTPSampler.monitor">false</boolProp>
          <stringProp name="HTTPSampler.embedded_url_re"></stringProp>
        </HTTPSampler>
        <hashTree/>
        <ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="View Results Tree" enabled="true">
          <boolProp name="ResultCollector.error_logging">false</boolProp>
          <objProp>
            <name>saveConfig</name>
            <value class="SampleSaveConfiguration">
              <time>true</time>
              <latency>true</latency>
              <timestamp>true</timestamp>
              <success>true</success>
              <label>true</label>
              <code>true</code>
              <message>true</message>
              <threadName>true</threadName>
              <dataType>true</dataType>
              <encoding>false</encoding>
              <assertions>true</assertions>
              <subresults>true</subresults>
              <responseData>false</responseData>
              <samplerData>false</samplerData>
              <xml>true</xml>
              <fieldNames>false</fieldNames>
              <responseHeaders>false</responseHeaders>
              <requestHeaders>false</requestHeaders>
              <responseDataOnError>false</responseDataOnError>
              <saveAssertionResultsFailureMessage>false</saveAssertionResultsFailureMessage>
              <assertionsResultsToSave>0</assertionsResultsToSave>
              <bytes>true</bytes>
            </value>
          </objProp>
          <stringProp name="filename">C:\Temp\resultTree.jtl</stringProp>
        </ResultCollector>
        <hashTree/>
      </hashTree>
    </hashTree>
  </hashTree>
</jmeterTestPlan>
*****************

How to solve this issue?

Thanks a lot,
Benoit Coppens
Senior Consultant, Global IT Medical Information
UCB Pharma S.A. Belgium
All4IT
Chemin du Foriest, 1420 Braine-l'Alleud, Belgium
Tel: +32 2 386 25 71
Fax: +32 2 386 32 44
Email: benoit.coppens@ucb.com
Web-site: http://www.ucb.com/
 
--------------------------------------------------------

Legal Notice: This electronic mail and its attachments are intended solely for the person(s) to whom they are addressed and contain information which is confidential or otherwise protected from disclosure, except for the purpose for which they are intended. Dissemination, distribution, or reproduction by anyone other than the intended recipients is prohibited and may be illegal. If you are not an intended recipient, please immediately inform the sender and return the electronic mail and its attachments and destroy any copies which may be in your possession. UCB screens electronic mails for viruses but does not warrant that this electronic mail is free of any viruses. UCB accepts no liability for any damage caused by any virus transmitted by this electronic mail. (Ref: #*UG1107)
--------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: Missing cookie

Posted by Deepak Shetty <sh...@gmail.com>.
hi
ok good something worked :).
The other thing I would try is
a. Make a request to secured page but the Authorization manager shouldnt be
in scope here (so you'll get a 401 with set-cookie )
b. Repeat the above request but with the Authorization manager in scope
Thread Group
   Simple Controller
      request secure
        Assert 401
   Simple controller
     request secure
     Http Auth Manager

regards
deepak

On Fri, Sep 11, 2009 at 1:02 AM, <Be...@ucb.com> wrote:

> Hi Deepak,
>
> Using the HTTpClient Httpsampler did not solve the issue but requesting a
> non-secured page before the secured one is the solution!
>
> Do you think that the reason of the issue is the fact that the http client
> behind jmeter handles the 401 response without letting know the upper layers
> of Jmeter (and therefore the cookie manager is not aware of the cookie
> present in the 401 response) ?
>
> Thanks,
> Benoit
>
> --------------------------------------------------------
>
> Legal Notice: This electronic mail and its attachments are intended solely
> for the person(s) to whom they are addressed and contain information which
> is confidential or otherwise protected from disclosure, except for the
> purpose for which they are intended. Dissemination, distribution, or
> reproduction by anyone other than the intended recipients is prohibited and
> may be illegal. If you are not an intended recipient, please immediately
> inform the sender and return the electronic mail and its attachments and
> destroy any copies which may be in your possession. UCB screens electronic
> mails for viruses but does not warrant that this electronic mail is free of
> any viruses. UCB accepts no liability for any damage caused by any virus
> transmitted by this electronic mail. (Ref: #*UG1107)
> --------------------------------------------------------
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

Re: Missing cookie

Posted by sebb <se...@gmail.com>.
On 11/09/2009, Benoit.Coppens@ucb.com <Be...@ucb.com> wrote:
> Hi Deepak,
>
>  Using the HTTpClient Httpsampler did not solve the issue but requesting a non-secured page before the secured one is the solution!
>
>  Do you think that the reason of the issue is the fact that the http client behind jmeter handles the 401 response without letting know the upper layers of Jmeter (and therefore the cookie manager is not aware of the cookie present in the 401 response) ?

Yes, JMeter needs to see the cookies because it does all the cookie handling.

>  Thanks,
>  Benoit
>
>
>  --------------------------------------------------------
>
>  Legal Notice: This electronic mail and its attachments are intended solely for the person(s) to whom they are addressed and contain information which is confidential or otherwise protected from disclosure, except for the purpose for which they are intended. Dissemination, distribution, or reproduction by anyone other than the intended recipients is prohibited and may be illegal. If you are not an intended recipient, please immediately inform the sender and return the electronic mail and its attachments and destroy any copies which may be in your possession. UCB screens electronic mails for viruses but does not warrant that this electronic mail is free of any viruses. UCB accepts no liability for any damage caused by any virus transmitted by this electronic mail. (Ref: #*UG1107)
>  --------------------------------------------------------
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>  For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


RE: Missing cookie

Posted by Be...@ucb.com.
Hi Deepak,

Using the HTTpClient Httpsampler did not solve the issue but requesting a non-secured page before the secured one is the solution!

Do you think that the reason of the issue is the fact that the http client behind jmeter handles the 401 response without letting know the upper layers of Jmeter (and therefore the cookie manager is not aware of the cookie present in the 401 response) ?

Thanks,
Benoit
 
--------------------------------------------------------

Legal Notice: This electronic mail and its attachments are intended solely for the person(s) to whom they are addressed and contain information which is confidential or otherwise protected from disclosure, except for the purpose for which they are intended. Dissemination, distribution, or reproduction by anyone other than the intended recipients is prohibited and may be illegal. If you are not an intended recipient, please immediately inform the sender and return the electronic mail and its attachments and destroy any copies which may be in your possession. UCB screens electronic mails for viruses but does not warrant that this electronic mail is free of any viruses. UCB accepts no liability for any damage caused by any virus transmitted by this electronic mail. (Ref: #*UG1107)
--------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: Missing cookie

Posted by Deepak Shetty <sh...@gmail.com>.
hi
a. Can you try using the HTTpClient Httpsampler? (i remember something to
the effect that NTLM worked only with HTTPClient version..
b. Your cookie is being set on a 401 response as well as the retry is
automatic(which may be why it isnt getting stored in the cookie manager( .
Would it be possible for you to make a request to a non secure page so that
you can get the session cookie working correctly and then make the secured
request? Also the cookie specifies a path as /Scooby whereas your request
has it Scooby/home.htm can you change that to /Scooby/home.htm (shouldnt
make a diff i think , but doesnt hurt to try )

regards
deepak

On Thu, Sep 10, 2009 at 9:00 AM, <Be...@ucb.com> wrote:

> Hi,
>
> I try to use JMeter (latest version) with a website built with
> Spring-Security where user authentication is managed by NTLM.
>
> When JMeter requests the URL, the server answers that it is waiting an NTLM
> authentication.
> In its response, the server provides also cookie with the JSESSION id.
> When JMeter answers with the NTLM authentication, the JSESSION cookie is
> missing.
> Why?
>
> Here are the headers:
>
> ***************
> GET /ScoobyDoo/home.htm HTTP/1.1
> Connection: keep-alive
> Authorization: Basic RTExODYxNjppcmxhMjAwOQ==
> User-Agent: Java/1.6.0_10
> Host: 10.1.38.144
> Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
>
> HTTP/1.1 401 Unauthorized
> Date: Thu, 10 Sep 2009 15:45:06 GMT
> Server: Apache/2.2.11 (Win32) mod_jk/1.2.27 PHP/5.2.5
> Set-Cookie: JSESSIONID=BE6CB49D5CA9B2E885A6540CDF4A50E3; Path=/ScoobyDoo
> WWW-Authenticate: NTLM
> Connection: Keep-Alive, Keep-Alive
> Content-Length: 0
> Keep-Alive: timeout=5, max=100
> Content-Type: text/html
>
> GET /ScoobyDoo/home.htm HTTP/1.1
> Connection: keep-alive
> Authorization: NTLM
> TlRMTVNTUAABAAAAB7IIoggACAAxAAAACQAJACgAAAAFASgKAAAAD0JFTDAwMTk4OFVDQi1DT1JQ
> User-Agent: Java/1.6.0_10
> Host: 10.1.38.144
> Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
> ***************
>
> And here is my JMeter config:
>
> *****************
> <?xml version="1.0" encoding="UTF-8"?>
> <jmeterTestPlan version="1.2" properties="2.1">
>  <hashTree>
>    <TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="DDR"
> enabled="true">
>      <stringProp name="TestPlan.comments"></stringProp>
>      <boolProp name="TestPlan.functional_mode">false</boolProp>
>      <boolProp name="TestPlan.serialize_threadgroups">false</boolProp>
>      <elementProp name="TestPlan.user_defined_variables"
> elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments"
> testname="User Defined Variables" enabled="true">
>        <collectionProp name="Arguments.arguments"/>
>      </elementProp>
>      <stringProp name="TestPlan.user_define_classpath"></stringProp>
>    </TestPlan>
>    <hashTree>
>      <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup"
> testname="Thread Group" enabled="true">
>        <elementProp name="ThreadGroup.main_controller"
> elementType="LoopController" guiclass="LoopControlPanel"
> testclass="LoopController" testname="Loop Controller" enabled="true">
>          <boolProp name="LoopController.continue_forever">false</boolProp>
>          <stringProp name="LoopController.loops">2</stringProp>
>        </elementProp>
>        <stringProp name="ThreadGroup.num_threads">2</stringProp>
>        <stringProp name="ThreadGroup.ramp_time">2</stringProp>
>        <longProp name="ThreadGroup.start_time">1252584792000</longProp>
>        <longProp name="ThreadGroup.end_time">1252584792000</longProp>
>        <boolProp name="ThreadGroup.scheduler">false</boolProp>
>        <stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
>        <stringProp name="ThreadGroup.duration"></stringProp>
>        <stringProp name="ThreadGroup.delay"></stringProp>
>      </ThreadGroup>
>      <hashTree>
>        <AuthManager guiclass="AuthPanel" testclass="AuthManager"
> testname="HTTP Authorization Manager" enabled="true">
>          <collectionProp name="AuthManager.auth_list">
>            <elementProp name="" elementType="Authorization">
>              <stringProp name="Authorization.url">http://10.1.38.144/
> </stringProp>
>              <stringProp name="Authorization.username">E118616</stringProp>
>              <stringProp
> name="Authorization.password">password</stringProp>
>              <stringProp name="Authorization.domain">UCB-CORP</stringProp>
>              <stringProp name="Authorization.realm"></stringProp>
>            </elementProp>
>          </collectionProp>
>        </AuthManager>
>        <hashTree/>
>        <ConfigTestElement guiclass="HttpDefaultsGui"
> testclass="ConfigTestElement" testname="HTTP Request Defaults"
> enabled="true">
>          <elementProp name="HTTPsampler.Arguments" elementType="Arguments"
> guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined
> Variables" enabled="true">
>            <collectionProp name="Arguments.arguments"/>
>          </elementProp>
>          <stringProp name="HTTPSampler.domain">10.1.38.144</stringProp>
>          <stringProp name="HTTPSampler.port"></stringProp>
>          <stringProp name="HTTPSampler.connect_timeout"></stringProp>
>          <stringProp name="HTTPSampler.response_timeout"></stringProp>
>          <stringProp name="HTTPSampler.protocol"></stringProp>
>          <stringProp name="HTTPSampler.contentEncoding"></stringProp>
>          <stringProp name="HTTPSampler.path"></stringProp>
>        </ConfigTestElement>
>        <hashTree/>
>        <CookieManager guiclass="CookiePanel" testclass="CookieManager"
> testname="HTTP Cookie Manager" enabled="true">
>          <collectionProp name="CookieManager.cookies"/>
>          <boolProp name="CookieManager.clearEachIteration">false</boolProp>
>        </CookieManager>
>        <hashTree/>
>        <HTTPSampler guiclass="HttpTestSampleGui" testclass="HTTPSampler"
> testname="AskMIKe Request" enabled="true">
>          <elementProp name="HTTPsampler.Arguments" elementType="Arguments"
> guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined
> Variables" enabled="true">
>            <collectionProp name="Arguments.arguments"/>
>          </elementProp>
>          <stringProp name="HTTPSampler.domain"></stringProp>
>          <stringProp name="HTTPSampler.port"></stringProp>
>          <stringProp name="HTTPSampler.connect_timeout"></stringProp>
>          <stringProp name="HTTPSampler.response_timeout"></stringProp>
>          <stringProp name="HTTPSampler.protocol"></stringProp>
>          <stringProp name="HTTPSampler.contentEncoding"></stringProp>
>          <stringProp
> name="HTTPSampler.path">ScoobyDoo/home.htm</stringProp>
>          <stringProp name="HTTPSampler.method">GET</stringProp>
>          <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
>          <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
>          <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
>          <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
>          <stringProp name="HTTPSampler.FILE_NAME"></stringProp>
>          <stringProp name="HTTPSampler.FILE_FIELD"></stringProp>
>          <stringProp name="HTTPSampler.mimetype"></stringProp>
>          <boolProp name="HTTPSampler.monitor">false</boolProp>
>          <stringProp name="HTTPSampler.embedded_url_re"></stringProp>
>        </HTTPSampler>
>        <hashTree/>
>        <ResultCollector guiclass="ViewResultsFullVisualizer"
> testclass="ResultCollector" testname="View Results Tree" enabled="true">
>          <boolProp name="ResultCollector.error_logging">false</boolProp>
>          <objProp>
>            <name>saveConfig</name>
>            <value class="SampleSaveConfiguration">
>              <time>true</time>
>              <latency>true</latency>
>              <timestamp>true</timestamp>
>              <success>true</success>
>              <label>true</label>
>              <code>true</code>
>              <message>true</message>
>              <threadName>true</threadName>
>              <dataType>true</dataType>
>              <encoding>false</encoding>
>              <assertions>true</assertions>
>              <subresults>true</subresults>
>              <responseData>false</responseData>
>              <samplerData>false</samplerData>
>              <xml>true</xml>
>              <fieldNames>false</fieldNames>
>              <responseHeaders>false</responseHeaders>
>              <requestHeaders>false</requestHeaders>
>              <responseDataOnError>false</responseDataOnError>
>
>  <saveAssertionResultsFailureMessage>false</saveAssertionResultsFailureMessage>
>              <assertionsResultsToSave>0</assertionsResultsToSave>
>              <bytes>true</bytes>
>            </value>
>          </objProp>
>          <stringProp name="filename">C:\Temp\resultTree.jtl</stringProp>
>        </ResultCollector>
>        <hashTree/>
>      </hashTree>
>    </hashTree>
>  </hashTree>
> </jmeterTestPlan>
> *****************
>
> How to solve this issue?
>
> Thanks a lot,
> Benoit Coppens
> Senior Consultant, Global IT Medical Information
> UCB Pharma S.A. Belgium
> All4IT
> Chemin du Foriest, 1420 Braine-l'Alleud, Belgium
> Tel: +32 2 386 25 71
> Fax: +32 2 386 32 44
> Email: benoit.coppens@ucb.com
> Web-site: http://www.ucb.com/
>
> --------------------------------------------------------
>
> Legal Notice: This electronic mail and its attachments are intended solely
> for the person(s) to whom they are addressed and contain information which
> is confidential or otherwise protected from disclosure, except for the
> purpose for which they are intended. Dissemination, distribution, or
> reproduction by anyone other than the intended recipients is prohibited and
> may be illegal. If you are not an intended recipient, please immediately
> inform the sender and return the electronic mail and its attachments and
> destroy any copies which may be in your possession. UCB screens electronic
> mails for viruses but does not warrant that this electronic mail is free of
> any viruses. UCB accepts no liability for any damage caused by any virus
> transmitted by this electronic mail. (Ref: #*UG1107)
> --------------------------------------------------------
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

RE: Missing cookie

Posted by Be...@ucb.com.
Yes, here it is:

>         <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true">
>           <collectionProp name="CookieManager.cookies"/>
>           <boolProp name="CookieManager.clearEachIteration">false</boolProp>
>         </CookieManager>
 
--------------------------------------------------------

Legal Notice: This electronic mail and its attachments are intended solely for the person(s) to whom they are addressed and contain information which is confidential or otherwise protected from disclosure, except for the purpose for which they are intended. Dissemination, distribution, or reproduction by anyone other than the intended recipients is prohibited and may be illegal. If you are not an intended recipient, please immediately inform the sender and return the electronic mail and its attachments and destroy any copies which may be in your possession. UCB screens electronic mails for viruses but does not warrant that this electronic mail is free of any viruses. UCB accepts no liability for any damage caused by any virus transmitted by this electronic mail. (Ref: #*UG1107)
--------------------------------------------------------

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: Missing cookie

Posted by sebb <se...@gmail.com>.
On 10/09/2009, Benoit.Coppens@ucb.com <Be...@ucb.com> wrote:
> Hi,
>
>  I try to use JMeter (latest version) with a website built with Spring-Security where user authentication is managed by NTLM.
>
>  When JMeter requests the URL, the server answers that it is waiting an NTLM authentication.
>  In its response, the server provides also cookie with the JSESSION id.
>  When JMeter answers with the NTLM authentication, the JSESSION cookie is missing.
>  Why?

Did you add a Cookie Manager?

>  Here are the headers:
>
>  ***************
>  GET /ScoobyDoo/home.htm HTTP/1.1
>  Connection: keep-alive
>  Authorization: Basic RTExODYxNjppcmxhMjAwOQ==
>  User-Agent: Java/1.6.0_10
>  Host: 10.1.38.144
>  Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
>
>  HTTP/1.1 401 Unauthorized
>  Date: Thu, 10 Sep 2009 15:45:06 GMT
>  Server: Apache/2.2.11 (Win32) mod_jk/1.2.27 PHP/5.2.5
>  Set-Cookie: JSESSIONID=BE6CB49D5CA9B2E885A6540CDF4A50E3; Path=/ScoobyDoo
>  WWW-Authenticate: NTLM
>  Connection: Keep-Alive, Keep-Alive
>  Content-Length: 0
>  Keep-Alive: timeout=5, max=100
>  Content-Type: text/html
>
>  GET /ScoobyDoo/home.htm HTTP/1.1
>  Connection: keep-alive
>  Authorization: NTLM TlRMTVNTUAABAAAAB7IIoggACAAxAAAACQAJACgAAAAFASgKAAAAD0JFTDAwMTk4OFVDQi1DT1JQ
>  User-Agent: Java/1.6.0_10
>  Host: 10.1.38.144
>  Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
>  ***************
>
>  And here is my JMeter config:
>
>  *****************
>  <?xml version="1.0" encoding="UTF-8"?>
>  <jmeterTestPlan version="1.2" properties="2.1">
>   <hashTree>
>     <TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="DDR" enabled="true">
>       <stringProp name="TestPlan.comments"></stringProp>
>       <boolProp name="TestPlan.functional_mode">false</boolProp>
>       <boolProp name="TestPlan.serialize_threadgroups">false</boolProp>
>       <elementProp name="TestPlan.user_defined_variables" elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
>         <collectionProp name="Arguments.arguments"/>
>       </elementProp>
>       <stringProp name="TestPlan.user_define_classpath"></stringProp>
>     </TestPlan>
>     <hashTree>
>       <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup" testname="Thread Group" enabled="true">
>         <elementProp name="ThreadGroup.main_controller" elementType="LoopController" guiclass="LoopControlPanel" testclass="LoopController" testname="Loop Controller" enabled="true">
>           <boolProp name="LoopController.continue_forever">false</boolProp>
>           <stringProp name="LoopController.loops">2</stringProp>
>         </elementProp>
>         <stringProp name="ThreadGroup.num_threads">2</stringProp>
>         <stringProp name="ThreadGroup.ramp_time">2</stringProp>
>         <longProp name="ThreadGroup.start_time">1252584792000</longProp>
>         <longProp name="ThreadGroup.end_time">1252584792000</longProp>
>         <boolProp name="ThreadGroup.scheduler">false</boolProp>
>         <stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
>         <stringProp name="ThreadGroup.duration"></stringProp>
>         <stringProp name="ThreadGroup.delay"></stringProp>
>       </ThreadGroup>
>       <hashTree>
>         <AuthManager guiclass="AuthPanel" testclass="AuthManager" testname="HTTP Authorization Manager" enabled="true">
>           <collectionProp name="AuthManager.auth_list">
>             <elementProp name="" elementType="Authorization">
>               <stringProp name="Authorization.url">http://10.1.38.144/</stringProp>
>               <stringProp name="Authorization.username">E118616</stringProp>
>               <stringProp name="Authorization.password">password</stringProp>
>               <stringProp name="Authorization.domain">UCB-CORP</stringProp>
>               <stringProp name="Authorization.realm"></stringProp>
>             </elementProp>
>           </collectionProp>
>         </AuthManager>
>         <hashTree/>
>         <ConfigTestElement guiclass="HttpDefaultsGui" testclass="ConfigTestElement" testname="HTTP Request Defaults" enabled="true">
>           <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
>             <collectionProp name="Arguments.arguments"/>
>           </elementProp>
>           <stringProp name="HTTPSampler.domain">10.1.38.144</stringProp>
>           <stringProp name="HTTPSampler.port"></stringProp>
>           <stringProp name="HTTPSampler.connect_timeout"></stringProp>
>           <stringProp name="HTTPSampler.response_timeout"></stringProp>
>           <stringProp name="HTTPSampler.protocol"></stringProp>
>           <stringProp name="HTTPSampler.contentEncoding"></stringProp>
>           <stringProp name="HTTPSampler.path"></stringProp>
>         </ConfigTestElement>
>         <hashTree/>
>         <CookieManager guiclass="CookiePanel" testclass="CookieManager" testname="HTTP Cookie Manager" enabled="true">
>           <collectionProp name="CookieManager.cookies"/>
>           <boolProp name="CookieManager.clearEachIteration">false</boolProp>
>         </CookieManager>
>         <hashTree/>
>         <HTTPSampler guiclass="HttpTestSampleGui" testclass="HTTPSampler" testname="AskMIKe Request" enabled="true">
>           <elementProp name="HTTPsampler.Arguments" elementType="Arguments" guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined Variables" enabled="true">
>             <collectionProp name="Arguments.arguments"/>
>           </elementProp>
>           <stringProp name="HTTPSampler.domain"></stringProp>
>           <stringProp name="HTTPSampler.port"></stringProp>
>           <stringProp name="HTTPSampler.connect_timeout"></stringProp>
>           <stringProp name="HTTPSampler.response_timeout"></stringProp>
>           <stringProp name="HTTPSampler.protocol"></stringProp>
>           <stringProp name="HTTPSampler.contentEncoding"></stringProp>
>           <stringProp name="HTTPSampler.path">ScoobyDoo/home.htm</stringProp>
>           <stringProp name="HTTPSampler.method">GET</stringProp>
>           <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
>           <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
>           <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
>           <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
>           <stringProp name="HTTPSampler.FILE_NAME"></stringProp>
>           <stringProp name="HTTPSampler.FILE_FIELD"></stringProp>
>           <stringProp name="HTTPSampler.mimetype"></stringProp>
>           <boolProp name="HTTPSampler.monitor">false</boolProp>
>           <stringProp name="HTTPSampler.embedded_url_re"></stringProp>
>         </HTTPSampler>
>         <hashTree/>
>         <ResultCollector guiclass="ViewResultsFullVisualizer" testclass="ResultCollector" testname="View Results Tree" enabled="true">
>           <boolProp name="ResultCollector.error_logging">false</boolProp>
>           <objProp>
>             <name>saveConfig</name>
>             <value class="SampleSaveConfiguration">
>               <time>true</time>
>               <latency>true</latency>
>               <timestamp>true</timestamp>
>               <success>true</success>
>               <label>true</label>
>               <code>true</code>
>               <message>true</message>
>               <threadName>true</threadName>
>               <dataType>true</dataType>
>               <encoding>false</encoding>
>               <assertions>true</assertions>
>               <subresults>true</subresults>
>               <responseData>false</responseData>
>               <samplerData>false</samplerData>
>               <xml>true</xml>
>               <fieldNames>false</fieldNames>
>               <responseHeaders>false</responseHeaders>
>               <requestHeaders>false</requestHeaders>
>               <responseDataOnError>false</responseDataOnError>
>               <saveAssertionResultsFailureMessage>false</saveAssertionResultsFailureMessage>
>               <assertionsResultsToSave>0</assertionsResultsToSave>
>               <bytes>true</bytes>
>             </value>
>           </objProp>
>           <stringProp name="filename">C:\Temp\resultTree.jtl</stringProp>
>         </ResultCollector>
>         <hashTree/>
>       </hashTree>
>     </hashTree>
>   </hashTree>
>  </jmeterTestPlan>
>  *****************
>
>  How to solve this issue?
>
>  Thanks a lot,
>  Benoit Coppens
>  Senior Consultant, Global IT Medical Information
>  UCB Pharma S.A. Belgium
>  All4IT
>  Chemin du Foriest, 1420 Braine-l'Alleud, Belgium
>  Tel: +32 2 386 25 71
>  Fax: +32 2 386 32 44
>  Email: benoit.coppens@ucb.com
>  Web-site: http://www.ucb.com/
>
>  --------------------------------------------------------
>
>  Legal Notice: This electronic mail and its attachments are intended solely for the person(s) to whom they are addressed and contain information which is confidential or otherwise protected from disclosure, except for the purpose for which they are intended. Dissemination, distribution, or reproduction by anyone other than the intended recipients is prohibited and may be illegal. If you are not an intended recipient, please immediately inform the sender and return the electronic mail and its attachments and destroy any copies which may be in your possession. UCB screens electronic mails for viruses but does not warrant that this electronic mail is free of any viruses. UCB accepts no liability for any damage caused by any virus transmitted by this electronic mail. (Ref: #*UG1107)
>  --------------------------------------------------------
>
>  ---------------------------------------------------------------------
>  To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>  For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: Missing cookie

Posted by Deepak Shetty <sh...@gmail.com>.
hi
and also can you try something like
Thread Group
   Defaults
   Cookie Manager
   Simple Controller
      HttpRequest (should fail , but sets cookie)
   Simple Controller
      HttpRequest (cookie should be sent here)
       Authorization Manager

regards
deepak


On Thu, Sep 10, 2009 at 9:00 AM, <Be...@ucb.com> wrote:

> Hi,
>
> I try to use JMeter (latest version) with a website built with
> Spring-Security where user authentication is managed by NTLM.
>
> When JMeter requests the URL, the server answers that it is waiting an NTLM
> authentication.
> In its response, the server provides also cookie with the JSESSION id.
> When JMeter answers with the NTLM authentication, the JSESSION cookie is
> missing.
> Why?
>
> Here are the headers:
>
> ***************
> GET /ScoobyDoo/home.htm HTTP/1.1
> Connection: keep-alive
> Authorization: Basic RTExODYxNjppcmxhMjAwOQ==
> User-Agent: Java/1.6.0_10
> Host: 10.1.38.144
> Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
>
> HTTP/1.1 401 Unauthorized
> Date: Thu, 10 Sep 2009 15:45:06 GMT
> Server: Apache/2.2.11 (Win32) mod_jk/1.2.27 PHP/5.2.5
> Set-Cookie: JSESSIONID=BE6CB49D5CA9B2E885A6540CDF4A50E3; Path=/ScoobyDoo
> WWW-Authenticate: NTLM
> Connection: Keep-Alive, Keep-Alive
> Content-Length: 0
> Keep-Alive: timeout=5, max=100
> Content-Type: text/html
>
> GET /ScoobyDoo/home.htm HTTP/1.1
> Connection: keep-alive
> Authorization: NTLM
> TlRMTVNTUAABAAAAB7IIoggACAAxAAAACQAJACgAAAAFASgKAAAAD0JFTDAwMTk4OFVDQi1DT1JQ
> User-Agent: Java/1.6.0_10
> Host: 10.1.38.144
> Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
> ***************
>
> And here is my JMeter config:
>
> *****************
> <?xml version="1.0" encoding="UTF-8"?>
> <jmeterTestPlan version="1.2" properties="2.1">
>  <hashTree>
>    <TestPlan guiclass="TestPlanGui" testclass="TestPlan" testname="DDR"
> enabled="true">
>      <stringProp name="TestPlan.comments"></stringProp>
>      <boolProp name="TestPlan.functional_mode">false</boolProp>
>      <boolProp name="TestPlan.serialize_threadgroups">false</boolProp>
>      <elementProp name="TestPlan.user_defined_variables"
> elementType="Arguments" guiclass="ArgumentsPanel" testclass="Arguments"
> testname="User Defined Variables" enabled="true">
>        <collectionProp name="Arguments.arguments"/>
>      </elementProp>
>      <stringProp name="TestPlan.user_define_classpath"></stringProp>
>    </TestPlan>
>    <hashTree>
>      <ThreadGroup guiclass="ThreadGroupGui" testclass="ThreadGroup"
> testname="Thread Group" enabled="true">
>        <elementProp name="ThreadGroup.main_controller"
> elementType="LoopController" guiclass="LoopControlPanel"
> testclass="LoopController" testname="Loop Controller" enabled="true">
>          <boolProp name="LoopController.continue_forever">false</boolProp>
>          <stringProp name="LoopController.loops">2</stringProp>
>        </elementProp>
>        <stringProp name="ThreadGroup.num_threads">2</stringProp>
>        <stringProp name="ThreadGroup.ramp_time">2</stringProp>
>        <longProp name="ThreadGroup.start_time">1252584792000</longProp>
>        <longProp name="ThreadGroup.end_time">1252584792000</longProp>
>        <boolProp name="ThreadGroup.scheduler">false</boolProp>
>        <stringProp name="ThreadGroup.on_sample_error">continue</stringProp>
>        <stringProp name="ThreadGroup.duration"></stringProp>
>        <stringProp name="ThreadGroup.delay"></stringProp>
>      </ThreadGroup>
>      <hashTree>
>        <AuthManager guiclass="AuthPanel" testclass="AuthManager"
> testname="HTTP Authorization Manager" enabled="true">
>          <collectionProp name="AuthManager.auth_list">
>            <elementProp name="" elementType="Authorization">
>              <stringProp name="Authorization.url">http://10.1.38.144/
> </stringProp>
>              <stringProp name="Authorization.username">E118616</stringProp>
>              <stringProp
> name="Authorization.password">password</stringProp>
>              <stringProp name="Authorization.domain">UCB-CORP</stringProp>
>              <stringProp name="Authorization.realm"></stringProp>
>            </elementProp>
>          </collectionProp>
>        </AuthManager>
>        <hashTree/>
>        <ConfigTestElement guiclass="HttpDefaultsGui"
> testclass="ConfigTestElement" testname="HTTP Request Defaults"
> enabled="true">
>          <elementProp name="HTTPsampler.Arguments" elementType="Arguments"
> guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined
> Variables" enabled="true">
>            <collectionProp name="Arguments.arguments"/>
>          </elementProp>
>          <stringProp name="HTTPSampler.domain">10.1.38.144</stringProp>
>          <stringProp name="HTTPSampler.port"></stringProp>
>          <stringProp name="HTTPSampler.connect_timeout"></stringProp>
>          <stringProp name="HTTPSampler.response_timeout"></stringProp>
>          <stringProp name="HTTPSampler.protocol"></stringProp>
>          <stringProp name="HTTPSampler.contentEncoding"></stringProp>
>          <stringProp name="HTTPSampler.path"></stringProp>
>        </ConfigTestElement>
>        <hashTree/>
>        <CookieManager guiclass="CookiePanel" testclass="CookieManager"
> testname="HTTP Cookie Manager" enabled="true">
>          <collectionProp name="CookieManager.cookies"/>
>          <boolProp name="CookieManager.clearEachIteration">false</boolProp>
>        </CookieManager>
>        <hashTree/>
>        <HTTPSampler guiclass="HttpTestSampleGui" testclass="HTTPSampler"
> testname="AskMIKe Request" enabled="true">
>          <elementProp name="HTTPsampler.Arguments" elementType="Arguments"
> guiclass="HTTPArgumentsPanel" testclass="Arguments" testname="User Defined
> Variables" enabled="true">
>            <collectionProp name="Arguments.arguments"/>
>          </elementProp>
>          <stringProp name="HTTPSampler.domain"></stringProp>
>          <stringProp name="HTTPSampler.port"></stringProp>
>          <stringProp name="HTTPSampler.connect_timeout"></stringProp>
>          <stringProp name="HTTPSampler.response_timeout"></stringProp>
>          <stringProp name="HTTPSampler.protocol"></stringProp>
>          <stringProp name="HTTPSampler.contentEncoding"></stringProp>
>          <stringProp
> name="HTTPSampler.path">ScoobyDoo/home.htm</stringProp>
>          <stringProp name="HTTPSampler.method">GET</stringProp>
>          <boolProp name="HTTPSampler.follow_redirects">true</boolProp>
>          <boolProp name="HTTPSampler.auto_redirects">false</boolProp>
>          <boolProp name="HTTPSampler.use_keepalive">true</boolProp>
>          <boolProp name="HTTPSampler.DO_MULTIPART_POST">false</boolProp>
>          <stringProp name="HTTPSampler.FILE_NAME"></stringProp>
>          <stringProp name="HTTPSampler.FILE_FIELD"></stringProp>
>          <stringProp name="HTTPSampler.mimetype"></stringProp>
>          <boolProp name="HTTPSampler.monitor">false</boolProp>
>          <stringProp name="HTTPSampler.embedded_url_re"></stringProp>
>        </HTTPSampler>
>        <hashTree/>
>        <ResultCollector guiclass="ViewResultsFullVisualizer"
> testclass="ResultCollector" testname="View Results Tree" enabled="true">
>          <boolProp name="ResultCollector.error_logging">false</boolProp>
>          <objProp>
>            <name>saveConfig</name>
>            <value class="SampleSaveConfiguration">
>              <time>true</time>
>              <latency>true</latency>
>              <timestamp>true</timestamp>
>              <success>true</success>
>              <label>true</label>
>              <code>true</code>
>              <message>true</message>
>              <threadName>true</threadName>
>              <dataType>true</dataType>
>              <encoding>false</encoding>
>              <assertions>true</assertions>
>              <subresults>true</subresults>
>              <responseData>false</responseData>
>              <samplerData>false</samplerData>
>              <xml>true</xml>
>              <fieldNames>false</fieldNames>
>              <responseHeaders>false</responseHeaders>
>              <requestHeaders>false</requestHeaders>
>              <responseDataOnError>false</responseDataOnError>
>
>  <saveAssertionResultsFailureMessage>false</saveAssertionResultsFailureMessage>
>              <assertionsResultsToSave>0</assertionsResultsToSave>
>              <bytes>true</bytes>
>            </value>
>          </objProp>
>          <stringProp name="filename">C:\Temp\resultTree.jtl</stringProp>
>        </ResultCollector>
>        <hashTree/>
>      </hashTree>
>    </hashTree>
>  </hashTree>
> </jmeterTestPlan>
> *****************
>
> How to solve this issue?
>
> Thanks a lot,
> Benoit Coppens
> Senior Consultant, Global IT Medical Information
> UCB Pharma S.A. Belgium
> All4IT
> Chemin du Foriest, 1420 Braine-l'Alleud, Belgium
> Tel: +32 2 386 25 71
> Fax: +32 2 386 32 44
> Email: benoit.coppens@ucb.com
> Web-site: http://www.ucb.com/
>
> --------------------------------------------------------
>
> Legal Notice: This electronic mail and its attachments are intended solely
> for the person(s) to whom they are addressed and contain information which
> is confidential or otherwise protected from disclosure, except for the
> purpose for which they are intended. Dissemination, distribution, or
> reproduction by anyone other than the intended recipients is prohibited and
> may be illegal. If you are not an intended recipient, please immediately
> inform the sender and return the electronic mail and its attachments and
> destroy any copies which may be in your possession. UCB screens electronic
> mails for viruses but does not warrant that this electronic mail is free of
> any viruses. UCB accepts no liability for any damage caused by any virus
> transmitted by this electronic mail. (Ref: #*UG1107)
> --------------------------------------------------------
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>