You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by "Paatsch, Bernd" <BP...@activevoice.com> on 2005/11/14 22:53:51 UTC

RE: HTTRequest / Set-Cookie

I know now, why I my login attempt fails. However I haven't figured out how
to fix it. I appreciate any suggestions.

Explanation:
When the site is loaded two cookies are set: 
Set-Cookie: c_txtLogin=deleted; expires=Sun, 14-Nov-04 21:31:05 GMT; path=/
Set-Cookie: c_pwdPassword=deleted; expires=Sun, 14-Nov-04 21:31:05 GMT;
path=/

When I run my script they are never changed.

When I login manual the cookies are changed to the login information.

The function that does set the cookies is /script/index.js:
  var docX = document.forms[0];
  :function SetCookie (name, value) 
  {  
    document.cookie = name + "=" + value + "; path=/";
  }
  function sendForm()
  {
   SetCookie (	"c_txtLogin",	docX.txtLoginForm.value);
   SetCookie (	"c_pwdPassword",	docX.pwdPasswordForm.value);
   docX.txtLoginForm.value = "";
   docX.pwdPasswordForm.value = "";
  } 
  docX.btnLogin.onclick = sendForm;
  

-----Original Message-----
From: Paatsch, Bernd [mailto:BPaatsch@activevoice.com]
Sent: Monday, November 14, 2005 8:32 AM
To: 'JMeter Users List'
Subject: RE: HTTRequest


I try to login to the web site I like to test. I know this sites uses
session cookies.
What I did is that in the "logon" HTTPRequest I send the login parameters
with the request as POST.
I did not set anything at the HTTP Session Manager.

Here is a sniff from the HTTP Request Header using a mnanual connection
login in and capturing the transmission:
POST /mm/status.php HTTP/1.1
Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
application/x-shockwave-flash, application/vnd.ms-powerpoint,
application/vnd.ms-excel, application/msword, */*
Referer: http://172.16.19.90/
Accept-Language: en-us
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)
Host: 172.16.19.90
Content-Length: 63
Connection: Keep-Alive
Cache-Control: no-cache
Cookie: g_lang=us; unique_session=7a72d897da95bf2658d609871fdc7367;
style=default; logoff_id=1; c_SessionID=-1; c_txtLogin=9208; c_pwdPassword=

txtLoginForm=&pwdPasswordForm=&sltDefLanguage=us&btnLogin=Login




-----Original Message-----
From: Noam Paz [mailto:noam.paz@db.com]
Sent: Monday, November 14, 2005 8:03 AM
To: JMeter Users List
Subject: RE: HTTRequest







>> Do I need to add cookies manual via the add button?
normally not...
what exactly is the error?
what parameter do you send with the failing request?

Best regards / Viele Grüße

Noam Paz




 

             "Paatsch, Bernd" <BP...@activevoice.com>

 

             14.11.2005 16:56
To 
 
"'JMeter Users List'" <jm...@jakarta.apache.org>

 
cc 
 
Please respond to

 
"JMeter Users List" <jm...@jakarta.apache.org>
Subject 
 
RE: HTTRequest

 

 

 

 

 

 





Nope, I have a HTTP Cookie Manager.
Do I need to add cookies manual via the add button?

-----Original Message-----
From: sebb [mailto:sebbaz@gmail.com]
Sent: Sunday, November 13, 2005 3:37 PM
To: JMeter Users List
Subject: Re: HTTRequest


Missing CookieManager?

On 13/11/05, Paatsch, Bernd <BP...@activevoice.com> wrote:
> I recoded a script using the proxy logging into a web-page.
> Replaying the script does not log me into the page even with all values
set
> as required.
>
> What could be the problem?
>
> Thanks,
> --Bernd
>
>
>

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





--

Diese E-Mail enthaelt vertrauliche und/oder rechtlich geschuetzte
Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail
irrtuemlich erhalten haben, informieren Sie bitte sofort den Absender und
vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte
Weitergabe dieser Mail ist nicht gestattet.

This e-mail may contain confidential and/or privileged information. If you
are not the intended recipient (or have received this e-mail in error)
please notify the sender immediately and destroy this e-mail. Any
unauthorized copying, disclosure or distribution of the material in this
e-mail is strictly forbidden.


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



Re: HTTRequest / Set-Cookie

Posted by sebb <se...@gmail.com>.
If you add the valid settings to a Cookie Manager, the danger is that
the initial server response will reset them.

So it looks like you'll need to provide the cookies for the login page
only; do this by adding a Cookie Manager as a child of the login
request.

Cookie Managers are applied to all samplers in scope, so you may need
to adjust the test plan accordingly.

Or you could cheat, and use a Header Manager under the login page, and
use it to create Set-Cookie headers. That might be the best.

The latest nightly has better Cookie handling and debug logging if you
want to try that.

The property to set in jmeter.properties is

log_level.jmeter.protocol.http.control.CookieManager=DEBUG

or

log_level.jmeter.protocol.http.control=DEBUG

will also turn on debugging for Header Manager etc.


S.
On 14/11/05, Paatsch, Bernd <BP...@activevoice.com> wrote:
>
>
> I know now, why I my login attempt fails. However I haven't figured out how
> to fix it. I appreciate any suggestions.
>
> Explanation:
> When the site is loaded two cookies are set:
> Set-Cookie: c_txtLogin=deleted; expires=Sun, 14-Nov-04 21:31:05 GMT; path=/
> Set-Cookie: c_pwdPassword=deleted; expires=Sun, 14-Nov-04 21:31:05 GMT;
> path=/
>
> When I run my script they are never changed.
>
> When I login manual the cookies are changed to the login information.
>
> The function that does set the cookies is /script/index.js:
>   var docX = document.forms[0];
>   :function SetCookie (name, value)
>   {
>     document.cookie = name + "=" + value + "; path=/";
>   }
>   function sendForm()
>   {
>    SetCookie (  "c_txtLogin",   docX.txtLoginForm.value);
>    SetCookie (  "c_pwdPassword",        docX.pwdPasswordForm.value);
>    docX.txtLoginForm.value = "";
>    docX.pwdPasswordForm.value = "";
>   }
>   docX.btnLogin.onclick = sendForm;
>
>
> -----Original Message-----
> From: Paatsch, Bernd [mailto:BPaatsch@activevoice.com]
> Sent: Monday, November 14, 2005 8:32 AM
> To: 'JMeter Users List'
> Subject: RE: HTTRequest
>
>
> I try to login to the web site I like to test. I know this sites uses
> session cookies.
> What I did is that in the "logon" HTTPRequest I send the login parameters
> with the request as POST.
> I did not set anything at the HTTP Session Manager.
>
> Here is a sniff from the HTTP Request Header using a mnanual connection
> login in and capturing the transmission:
> POST /mm/status.php HTTP/1.1
> Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg,
> application/x-shockwave-flash, application/vnd.ms-powerpoint,
> application/vnd.ms-excel, application/msword, */*
> Referer: http://172.16.19.90/
> Accept-Language: en-us
> Content-Type: application/x-www-form-urlencoded
> Accept-Encoding: gzip, deflate
> User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)
> Host: 172.16.19.90
> Content-Length: 63
> Connection: Keep-Alive
> Cache-Control: no-cache
> Cookie: g_lang=us;
> unique_session=7a72d897da95bf2658d609871fdc7367;
> style=default; logoff_id=1; c_SessionID=-1; c_txtLogin=9208; c_pwdPassword=
>
> txtLoginForm=&pwdPasswordForm=&sltDefLanguage=us&btnLogin=Login
>
>
>
>
> -----Original Message-----
> From: Noam Paz [mailto:noam.paz@db.com]
> Sent: Monday, November 14, 2005 8:03 AM
> To: JMeter Users List
> Subject: RE: HTTRequest
>
>
>
>
>
>
>
> >> Do I need to add cookies manual via the add button?
> normally not...
> what exactly is the error?
> what parameter do you send with the failing request?
>
> Best regards / Viele Grüße
>
> Noam Paz
>
>
>
>
>
>
>              "Paatsch, Bernd" <BP...@activevoice.com>
>
>
>
>              14.11.2005 16:56
> To
>
> "'JMeter Users List'" <jm...@jakarta.apache.org>
>
>
> cc
>
> Please respond to
>
>
> "JMeter Users List" <jm...@jakarta.apache.org>
> Subject
>
> RE: HTTRequest
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> Nope, I have a HTTP Cookie Manager.
> Do I need to add cookies manual via the add button?
>
> -----Original Message-----
> From: sebb [mailto:sebbaz@gmail.com]
> Sent: Sunday, November 13, 2005 3:37 PM
> To: JMeter Users List
> Subject: Re: HTTRequest
>
>
> Missing CookieManager?
>
> On 13/11/05, Paatsch, Bernd <BP...@activevoice.com> wrote:
> > I recoded a script using the proxy logging into a web-page.
> > Replaying the script does not log me into the page even with all values
> set
> > as required.
> >
> > What could be the problem?
> >
> > Thanks,
> > --Bernd
> >
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> jmeter-user-help@jakarta.apache.org
>
>
>
>
>
> --
>
> Diese E-Mail enthaelt vertrauliche und/oder rechtlich geschuetzte
> Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail
> irrtuemlich erhalten haben, informieren Sie bitte sofort den Absender und
> vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte
> Weitergabe dieser Mail ist nicht gestattet.
>
> This e-mail may contain confidential and/or privileged information. If you
> are not the intended recipient (or have received this e-mail in error)
> please notify the sender immediately and destroy this e-mail. Any
> unauthorized copying, disclosure or distribution of the material in this
> e-mail is strictly forbidden.
>
>
> ---------------------------------------------------------------------
> 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