How do I dynamically change the value of the variable before a specific
request.
I need to send this for request#12:
"Cookie: s_cc=true; s_sq=%5B%5BB%5D%5D; "
and
I need to send this for for request#18:
"Cookie: s_cc=true;
s_sq=aolregistrationdev%3D%2526pid%253Dreg%252520%25253A%252520Free%252520AOL%252520Registration%252520G2%2526pidt%253D1%2526oid%253DSubmit%2526oidt%253D3%2526ot%253DSUBMIT%2526oi%253D219"
sebb-2-2 wrote:
>
> As I just wrote:
>
>> > However, you can use variables in the Cookie Manager.
>> > So if the server does not mind getting extra cookies, you can define
>> > the extra cookies that you need, and set the variables as needed.
>
> So add a cookie which looks like:
>
> Name: s_ec
> Value: ${xyx}
>
> and define xyz to be whatever you want.
>
> On 29/09/2008, henryd <[EMAIL PROTECTED]> wrote:
>>
>> I have two requests out of the 20 request that have a browser cookie.
>> The
>> problem I am having is that the same cookie (eg: s_ec) needs to be sent
>> with
>> different values for request #12 and request #18. If I add this cookie,
>> I am
>> unable to change the value of the cookie.
>>
>>
>>
>> sebb-2-2 wrote:
>> >
>> > On 29/09/2008, henryd <[EMAIL PROTECTED]> wrote:
>> >>
>> >> It is still not working for me. I have a cookie manager at the
>> thread
>> >> group
>> >> level for all my 20 requests. I added a "cookie manager" as a child
>> for
>> >> one
>> >> request and added two cookies to it. These cookies are not being
>> sent
>> >> along
>> >> with my request. They get sent only if I disable the main "cookie
>> >> manager"
>> >> at the thread group level. I am stuck as it appears like Jmeter does
>> not
>> >>
>> >> support adding a browser cookie for one or two requests in my thread
>> >> group
>> >> while I have another cookie manager at the thread group level for
>> server
>> >> cookies for the remaining 18 requests.
>> >>
>> >
>> > You wrote that you were not interested in server cookies, which is why
>> I
>> > wrote:
>> >
>> >>> Yes, if you want to ignore server cookies, just add the cookie
>> manager
>> >>> as a child of each request that needs the specific cookies.
>> >
>> > If a Sampler finds multiple Cookie Managers in the same scope, then
>> > only one CM will be used - as you have found out.
>> >
>> > However, you can use variables in the Cookie Manager.
>> > So if the server does not mind getting extra cookies, you can define
>> > the extra cookies that you need, and set the variables as needed.
>> >
>> >>
>> >> sebb-2-2 wrote:
>> >> >
>> >> > On 28/09/2008, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>> >> >>
>> >> >> Sorry, if I did not make myself clear. I am using
>> "2.3.2.r665936". I
>> >> am
>> >> >> not concerned about the cookies sent by server in this case. The
>> >> >> javascripts on my web pages set some cookies for certain requests
>> >> >> resulting in browser sending a request to the server with this
>> new
>> >> cookie
>> >> >> or a different value for the same cookie. This is where I am
>> having
>> >> real
>> >> >> problem. Is there any way to send a specific cookie for a couple
>> of
>> >> >> requests in my thread group where I have 20 requests all
>> together.
>> >> >
>> >> > Yes, if you want to ignore server cookies, just add the cookie
>> manager
>> >> > as a child of each request that needs the specific cookies.
>> >> >
>> >> >> BTW, what happens when I set "automatic redirection" and the
>> server
>> >> sets
>> >> >> a new cookie and issues a 302 and the subsequent request goes to
>> the
>> >> >> redirected url with this new cookie. Will this work in Jmeter or
>> do I
>> >> >> need to create two different requests instead of setting
>> "automatic
>> >> >> redirection".
>> >> >>
>> >> >
>> >> > No and no - please see:
>> >> >
>> >> >
>> >>
>> http://jakarta.apache.org/jmeter/usermanual/component_reference.html#HTTP_Request
>> >> >
>> >> > See "Redirect Automatically" and "Follow Redirects"
>> >> >
>> >> >> sebb-2-2 wrote:
>> >> >> >
>> >> >> > No need to use multiple cookie managers - anyway, they won't
>> work.
>> >> >> >
>> >> >> > If the server sets a cookie, it will be seen by JMeter (unless
>> you
>> >> are
>> >> >> > using redirect automatically), and JMeter will send any
>> relevant
>> >> >> > cookies with the next request.
>> >> >> >
>> >> >> > If you want to add your own cookies, add them to the cookie
>> >> manager.
>> >> >> > But this is rarely needed.
>> >> >> >
>> >> >> > Note that there was a problem in 2.3.1 if you selected "Clear
>> >> cookies
>> >> >> > each iteration".
>> >> >> >
>> >> >> > Upgrade to 2.3.2 if necessary.
>> >> >> >
>> >> >> > On 28/09/2008, henryd <[EMAIL PROTECTED]> wrote:
>> >> >> >>
>> >> >> >> I have tried adding "Cookie" as a header and jmeter does not
>> >> treat
>> >> >> it as
>> >> >> >> cookie and that does not appear in the outgoing request. I
>> wish
>> >> I
>> >> >> could
>> >> >> >> use
>> >> >> >> additional "Cookie Managers" in addition to adding at
>> thread
>> >> level
>> >> >> to
>> >> >> >> add
>> >> >> >> extra cookies or change cookies to what I am getting by
>> adding
>> >> it at
>> >> >> the
>> >> >> >> thread level.
>> >> >> >>
>> >> >> >>
>> >> >> >>
>> >> >> >>
>> >> >> >> Laurent Perez wrote:
>> >> >> >> >
>> >> >> >> >> How can I add my own cookies for some requests. If I add
>> it
>> >> to
>> >> >> the
>> >> >> >> cookie
>> >> >> >> >> manager at the thread level, these cookies get added to
>> all
>> >> >> requests.
>> >> >> >> >
>> >> >> >> > I believe you can use
>> >> >> >> >
>> >> >> >>
>> >> >>
>> >>
>> http://jakarta.apache.org/jmeter/usermanual/component_reference.html#HTTP_Header_Manager
>> >> >> >> > at the HTTP Request level (instead of Thread group level).
>> >> >> >> >
>> >> >> >> > So I guess you could create a header named Cookie for each
>> >> >> request. If
>> >> >> >> > cookies values need to be dynamic ones, you could use some
>> >> post
>> >> >> >> > processor to extract Set-cookie values from the response
>> and
>> >> store
>> >> >> >> > them as variables.
>> >> >> >> >
>> >> >> >> > Don't know if this would fit your needs, I never tried
>> this.
>> >> >> >> >
>> >> >> >> > laurent
>> >> >> >> >
>> >> >> >> >
>> >> >> >> >>
>> >> >> >> >> Sincerely appreciate your help.
>> >> >> >> >> --
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
--
View this message in context:
http://www.nabble.com/Insert-Cookies-for-some-requests-in-a-thread-group-tp19709256p19744133.html
Sent from the JMeter - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]