HomeSUPPORT QUESTIONS

Need help with StresStimulus? Start here.

Parameterization of cookies Messages in this topic - RSS

Todd Mitchell
Todd Mitchell
Posts: 4


1/22/2013
Todd Mitchell
Todd Mitchell
Posts: 4
Hello All,

I'm currently using a trial of version 2.5.4752 and having trouble setting a cookie using a datasource.   When I run or verify the test, it doesn't include the cookie yet when I use the same datasource on a querystring, it includes it correctly.
Any help would be appreciated.






0 link
Vadim @StresStimulus
Vadim @StresStimulus
Administrator
Posts: 583


1/22/2013
Vadim @StresStimulus
Vadim @StresStimulus
Administrator
Posts: 583
Hello Todd,
There are 2 rules of handling cookies in StresStimulus:
  1. Before recording a test case, clear cookies for the tested domain. This is done automatically by the recorder. However if the recorder is not used, this should be done manually.
([VK]Update of Jan-23: if web application uses tracking cookies, then this rule is required only to emulate new visitors. To emulate returning visitors: a) in the recorder, uncheck " clear cash" to keep existing tracking cookies, b) in StresStimulus, enable Browser Caching and  c) set "New VU %" to 0%)

  2. Start recording from the beginning, including the very first request that establishes a session.
Also, cookies are auto-correlated by StresStimulus automatically, so parameterization is not required and even can break the session integrity during the test run.
It looks like your 2-d screenshot displays the 1-st request, because the response contains the Set-Cookie for ASP.NET session. So you followed the rule # 2.
However, your 1-st request already includes SC_ANALYT ICS_GLOBAL_COOKIE, which should not be there, if you would follow the rule 1. if you do not use the recorder, then clear cookie manually.

Also, typically cookies are generated by the server, so please make sure that you really need to parameterize the SC_ANALYT ICS_GLOBAL_COOKIE with the dataset, because the requests with altered cookies can be rejected by the server.

Cheers,
-Vadim
0 link
Todd Mitchell
Todd Mitchell
Posts: 4


1/22/2013
Todd Mitchell
Todd Mitchell
Posts: 4
Thanks Vadim.

In my scenario I must parameterize the sc_analytics_global_cookie because it enables me to track a person across muliple visits/sessions therefore I wish to run w/ the same cookie across multiple test runs.  From what I understand you're saying - the tool does not work this way??
0 link
Vadim @StresStimulus
Vadim @StresStimulus
Administrator
Posts: 583


1/23/2013
Vadim @StresStimulus
Vadim @StresStimulus
Administrator
Posts: 583
Todd,
It looks like your goal is to emulate returning users with tracking cookies. You certainly can do this with StresStimulus.  (I confused a tracking cookie with a session cookie at first.)
In this case, it is fine to not clear cookies before recording by unchecking "clear cookie" in the recorder (which you probably already did). You can also keep the dataset parameterization.
Additionally, you need to enable browser caching and set "New VU %" to 100%   0%  ([VK] corrected on Jan-23), as the browser caching is disabled by default ([VK] the screenshot was replaced on  Jan-23 to reflect 0%).


Cheers,
-Vadim
0 link
Todd Mitchell
Todd Mitchell
Posts: 4


1/23/2013
Todd Mitchell
Todd Mitchell
Posts: 4
Vadim,
Thanks, I tried these options with no luck. The tool is not shipping the cookie I'm specifying on the first request. Any other thoughts?
0 link
Vadim @StresStimulus
Vadim @StresStimulus
Administrator
Posts: 583


1/23/2013
Vadim @StresStimulus
Vadim @StresStimulus
Administrator
Posts: 583
Todd,
The .ssconfig file  does not contain enough information. Can you upload your test to our secure support repository, so I can examine it.  To do so, in StresStimulus main menu ->  support options,  select " upload support case"
 I will check and let you know what to change.
Cheers,
-Vadim
0 link
Vadim @StresStimulus
Vadim @StresStimulus
Administrator
Posts: 583


1/24/2013
Vadim @StresStimulus
Vadim @StresStimulus
Administrator
Posts: 583
Hello Todd,
I checked your test case and here are two recommendations on how to modify its configuration:
1. Parameterization. The recorded value of the cookie header is:
        SC_ANALYTICS_GLOBAL_COOKIE=63a8318700b94482817326c598a0feb8; <other cookies>
You parameterised it as:
        {{visitorid.vid$Sequential}}
It should be changed to:
        SC_ANALYTICS_GLOBAL_COOKIE={{visitorid.vid$VU_Bound}}; <other cookies>
Your dataset is defined to store only the cookie value, not cookie name. So you should use it to replace the just recorded value and keep everything else in place. Also, please  use VU_Bound data-binding method so every VU will use the same cookie on all its requests.
 

 
2. Enable browser caching as shown on the screenshot in my previous post above. Please note that "New VU %" should be 0%, not 100% as I incorrectly said before. (I placed a few corrections above in bold).
 
As a result, the tracking cookie will be parametrized.

Does this make sense?
-Vadim
0 link
Todd Mitchell
Todd Mitchell
Posts: 4


1/24/2013
Todd Mitchell
Todd Mitchell
Posts: 4
Hi Vadim,
The cookie is now being shipped correctly according to your configuration notes.  I also set the % of new VUs restarting browsers to 0%.  This enables me to precisely control the way my users behave!

Regarding your email: the extra cookie was my fault.   I manually added it as I was testing something so you should not have to account for this unless it's in the http spec.
Thanks so much.

Now - on to authentication!
0 link
Vadim @StresStimulus
Vadim @StresStimulus
Administrator
Posts: 583


1/24/2013
Vadim @StresStimulus
Vadim @StresStimulus
Administrator
Posts: 583
Todd,
Thanks for letting me know that everything works well.
if you will have any questions on authentication, just start a new thread.

Cheers,
-Vadim
0 link






Copyright © 2017 Stimulus Technology