You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Gisela Kogler <G....@betandwin.com> on 2006/02/21 18:22:27 UTC

JMeter: HTTP Cookie Manager - configuration problem with local variable

Dear Jakarta JMeter Developer Group!
 
First of all - you did a good work so far!!! Thank you for this really, really useful stress-test-toolbox!
 
But now - why I am writing? Yes, of course: I have a big (for me not logical) problem: I can not add a cookie within the HTTP Cookie Manager manually which has a dynamically value (this value is a local variable should be filled by the outcome of a Regular Extractor Rule; see the structure below).
The value has to be dynamically changeable, because the value is a token which has been generated dynamically before within a BeanShell. The token has to be generated within a BeanShell, because I want to overgo bottlenecks we have with our login-database (which, in fact, has nothing to do with this stress-test, but
with the hardware architecture ...).
 
So here is the structure:
 
Thread Group:
|
-1.) BeanShell Sampler (generates a token an puts it into the ResponseMessage)
|     |
|      - Regular Expresson Extractor (gets the token String out of the ResponseMessage into the local variable tokenValue)
|
|- 2.) HTTP Cookie Manager with one manually added Cookie:
|        Name: TOKEN
|        Value: ${tokenValue}
|        Domain: .betandwin.com
|        Path: /
|        Security: not enabled
|
-3.) HTTP Request (which needs the token as Cookie Data, so that the Request looks like this: 
    GET http://rbweb.betandwin.com:8080/displayMyBetsXML?dateFrom=2005-12-01&dateTo=2006-01-31&details=1&type=ALL <http://rbweb.betandwin.com:8080/displayMyBetsXML?dateFrom=2005-12-01&dateTo=2006-01-31&details=1&type=ALL> 
    Cookie Data:
    ABPTOKEN=nSfm1d4u/U/VAElK8jJQubQl6y6QfpPYdF9BGj3I16bFlipSqMKX78g==
 
 
The problem is that my HTTP Request looks like this:
GET http://rbweb.betandwin.com:8080/displayMyBetsXML?dateFrom=2005-12-01&dateTo=2006-01-31&details=1&type=ALL <http://rbweb.betandwin.com:8080/displayMyBetsXML?dateFrom=2005-12-01&dateTo=2006-01-31&details=1&type=ALL> 
Cookie Data:
ABPTOKEN=${tokenValue}
 
 
 
I really would feel much happier, if you can provide any solution ... because I have already searched for one for a long time and I really need it asap.
 
Thank you in advance,
 

  
Gisela Kogler
Software Developer

Web http://www.betandwin.com <http://www.betandwin.com/> * 
WAP http://wap.betandwin.com* 
Office +43-1-585 6044-7308
Fax +43-1-585 6044-16

E-mail g.kogler@betandwin.com
S-mail Börsegasse 11/Top floor, 
1010 Vienna, Austria 

[Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich 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 unauthorised copying, disclosure or distribution of the material in this e-mail is strictly forbidden.]

*operated by the subsidiary BAW International Ltd. 
 

Re: JMeter: HTTP Cookie Manager - configuration problem with local variable

Posted by sebb <se...@gmail.com>.
Sorry, but the Cookie Manager does not support variable cookie values.

You may be able to use the Header Manager instead - I've not tried.

Otherwise, given that you are already using BeanShell, you may be able
to find the Cookie Manager object, and add the cookie yourself.

BTW, there is no need to use BeanShell Sampler to generate a sample
and then extract it using the RE extractor. BeanShell scripts have
access to the thread variables - see the manual.

And unless you need to calculate the cookies at run-time, you might as
well put them in a file and use CSV DataSet to create the variables.

See also the JMeter FAQ.


S.
On 21/02/06, Gisela Kogler <G....@betandwin.com> wrote:
>
>
> Dear Jakarta JMeter Developer Group!
>
> First of all - you did a good work so far!!! Thank you for this really, really useful stress-test-toolbox!
>
> But now - why I am writing? Yes, of course: I have a big (for me not logical) problem: I can not add a cookie within the HTTP Cookie Manager manually which has a dynamically value (this value is a local variable should be filled by the outcome of a Regular Extractor Rule; see the structure below).
> The value has to be dynamically changeable, because the value is a token which has been generated dynamically before within a BeanShell. The token has to be generated within a BeanShell, because I want to overgo bottlenecks we have with our login-database (which, in fact, has nothing to do with this stress-test, but
> with the hardware architecture ...).
>
> So here is the structure:
>
> Thread Group:
> |
> -1.) BeanShell Sampler (generates a token an puts it into the ResponseMessage)
> |     |
> |      - Regular Expresson Extractor (gets the token String out of the ResponseMessage into the local variable tokenValue)
> |
> |- 2.) HTTP Cookie Manager with one manually added Cookie:
> |        Name: TOKEN
> |        Value: ${tokenValue}
> |        Domain: .betandwin.com
> |        Path: /
> |        Security: not enabled
> |
> -3.) HTTP Request (which needs the token as Cookie Data, so that the Request looks like this:
>     GET http://rbweb.betandwin.com:8080/displayMyBetsXML?dateFrom=2005-12-01&dateTo=2006-01-31&details=1&type=ALL
>     Cookie Data:
>     ABPTOKEN=nSfm1d4u/U/VAElK8jJQubQl6y6QfpPYdF9BGj3I16bFlipSqMKX78g==
>
>
> The problem is that my HTTP Request looks like this:
> GET http://rbweb.betandwin.com:8080/displayMyBetsXML?dateFrom=2005-12-01&dateTo=2006-01-31&details=1&type=ALL
> Cookie Data:
> ABPTOKEN=${tokenValue}
>
>
>
> I really would feel much happier, if you can provide any solution ... because I have already searched for one for a long time and I really need it asap.
>
> Thank you in advance,
>
>
>
>
>
>
>
> Gisela Kogler
> Software Developer
>
>
>
>
> Web http://www.betandwin.com*
> WAP http://wap.betandwin.com*
> Office +43-1-585 6044-7308
> Fax +43-1-585 6044-16
>
>
> E-mail g.kogler@betandwin.com
> S-mail Börsegasse 11/Top floor,
> 1010 Vienna, Austria
>
>
> [Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich 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 unauthorised copying, disclosure or distribution of the material in this e-mail is strictly forbidden.]
>
> *operated by the subsidiary BAW International Ltd.
>

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