On 2 November 2010 18:59, denis boutin <dbou...@c-log.com> wrote:
> Hi,
>
> I'm trying to read a cookie value inside JMeter2.4. Do you know how can I do
> that  ?
>
> I've tried using a cookie manager which works well. However now in a certain
> part of my scenario I'd like to read a value of a cookie. So I've tried
> various solution, however none of them were successfull.
> Direct acess to ${JSESSIONID} which is the name of the cookie correctly
> filled. However, the ${JSESSIONID} return ${JSESSIONID} and not the content
> of cookie

That's because the JSESSIONID variable is not defined.
Also, cookies are called COOKIE_cookiename, see:

http://jakarta.apache.org/jmeter/usermanual/component_reference.html#HTTP_Cookie_Manager

> With an regexp extractor this is the same thing
> Nom de référence : gna
> Expression régulière : JSESSIONID=(.*)
> Canevas : $1$

You need to set the RE extractor source to the Headers.

> Test avec un postProcesseur beanshell :
> System.out.println("test");
> System.out.println("${JSESSIONID}"); // return ${JSESSIONID}
> System.out.println("toto");
> System.out.println(vars.get("JSESSIONID")); // null
> System.out.println("cookie count : " +
> sampler.getCookieManager().getCookieCount()); // not executed probably due
> to bad syntax...
>
> Blured.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscr...@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-h...@jakarta.apache.org
>
>

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

Reply via email to