You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Mordechai <mr...@gmail.com> on 2009/08/19 21:04:46 UTC

writnng to reading to cookies

How to send dynamic # of http requests


I want to be able to write to a cookie to store values that I'll need for
later requests.  The point of this behavior is to mimiick the application
under tests behavior of storing needed values in a cookie created by
javascript.   I want to be able to store the values per cookie per thread,
and then read them or write to them when needed.  Is there anyway to do
this? 

Is there a creative or easier way to miimick this client side created
cookie?

Thanks.
m

-- 
View this message in context: http://www.nabble.com/writnng-to-reading-to-cookies-tp25050066p25050066.html
Sent from the JMeter - User mailing list archive at Nabble.com.


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


Re: writnng to reading to cookies

Posted by Deepak Shetty <sh...@gmail.com>.
Hi
ThreadGroup
    HttpRequest
      BeanShell Pre Processor
    CookieManager


This is what the Pre Processor should have
import org.apache.jmeter.protocol.http.control.CookieManager;
import org.apache.jmeter.protocol.http.control.Cookie;
CookieManager manager = sampler.getCookieManager();
Cookie cookie = new Cookie("<NAME>","<VALUE>","<HOST>","/",false,0);
manager.add(cookie);

The only reason Im using a pre processor is Im not sure how else to get the
CookieManager , but I suppose there is a way . ideally I'd do this in a post
processor .

regards
deepak



On Wed, Aug 19, 2009 at 1:11 PM, Mordechai <mr...@gmail.com>wrote:

>
> Thanks for the quick reply.
>
> Read through the listed methods.  Could you show a quick example of how to
> call one of the methods that are listed in the
>
> http://jakarta.apache.org/jmeter/api/org/apache/jmeter/protocol/http/control/CookieManager.html
>
> Even a very brief basic example calling any method listed there would be
> helpful to get started...
>
> Thanks.
> m
>
>
> Deepak Shetty wrote:
> >
> > Hi
> >
> > Write a beanshell pre processor and use sampler.getCookieManager
> >
> http://jakarta.apache.org/jmeter/api/org/apache/jmeter/protocol/http/control/CookieManager.html
> >
> > regards
> > deepak
> >
> >
> > On Wed, Aug 19, 2009 at 12:04 PM, Mordechai
> > <mr...@gmail.com>wrote:
> >
> >>
> >> How to send dynamic # of http requests
> >>
> >>
> >> I want to be able to write to a cookie to store values that I'll need
> for
> >> later requests.  The point of this behavior is to mimiick the
> application
> >> under tests behavior of storing needed values in a cookie created by
> >> javascript.   I want to be able to store the values per cookie per
> >> thread,
> >> and then read them or write to them when needed.  Is there anyway to do
> >> this?
> >>
> >> Is there a creative or easier way to miimick this client side created
> >> cookie?
> >>
> >> Thanks.
> >> m
> >>
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/writnng-to-reading-to-cookies-tp25050066p25050066.html
> >> Sent from the JMeter - User mailing list archive at Nabble.com.
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> >> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/writnng-to-reading-to-cookies-tp25050066p25051135.html
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

Re: writnng to reading to cookies

Posted by Mordechai <mr...@gmail.com>.
Thanks for the quick reply.

Read through the listed methods.  Could you show a quick example of how to
call one of the methods that are listed in the 
http://jakarta.apache.org/jmeter/api/org/apache/jmeter/protocol/http/control/CookieManager.html

Even a very brief basic example calling any method listed there would be
helpful to get started...

Thanks.
m


Deepak Shetty wrote:
> 
> Hi
> 
> Write a beanshell pre processor and use sampler.getCookieManager
> http://jakarta.apache.org/jmeter/api/org/apache/jmeter/protocol/http/control/CookieManager.html
> 
> regards
> deepak
> 
> 
> On Wed, Aug 19, 2009 at 12:04 PM, Mordechai
> <mr...@gmail.com>wrote:
> 
>>
>> How to send dynamic # of http requests
>>
>>
>> I want to be able to write to a cookie to store values that I'll need for
>> later requests.  The point of this behavior is to mimiick the application
>> under tests behavior of storing needed values in a cookie created by
>> javascript.   I want to be able to store the values per cookie per
>> thread,
>> and then read them or write to them when needed.  Is there anyway to do
>> this?
>>
>> Is there a creative or easier way to miimick this client side created
>> cookie?
>>
>> Thanks.
>> m
>>
>> --
>> View this message in context:
>> http://www.nabble.com/writnng-to-reading-to-cookies-tp25050066p25050066.html
>> Sent from the JMeter - User mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>>
>>
> 
> 

-- 
View this message in context: http://www.nabble.com/writnng-to-reading-to-cookies-tp25050066p25051135.html
Sent from the JMeter - User mailing list archive at Nabble.com.


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


Re: writnng to reading to cookies

Posted by Deepak Shetty <sh...@gmail.com>.
Hi

Write a beanshell pre processor and use sampler.getCookieManager
http://jakarta.apache.org/jmeter/api/org/apache/jmeter/protocol/http/control/CookieManager.html

regards
deepak


On Wed, Aug 19, 2009 at 12:04 PM, Mordechai <mr...@gmail.com>wrote:

>
> How to send dynamic # of http requests
>
>
> I want to be able to write to a cookie to store values that I'll need for
> later requests.  The point of this behavior is to mimiick the application
> under tests behavior of storing needed values in a cookie created by
> javascript.   I want to be able to store the values per cookie per thread,
> and then read them or write to them when needed.  Is there anyway to do
> this?
>
> Is there a creative or easier way to miimick this client side created
> cookie?
>
> Thanks.
> m
>
> --
> View this message in context:
> http://www.nabble.com/writnng-to-reading-to-cookies-tp25050066p25050066.html
> Sent from the JMeter - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>