Wednesday, January 5, 2022

How to correlate Cookies in LoadRunner? or Vugen?

An HTTP cookie (also known as a web cookie or browser cookie) is a small piece of data sent by a server to a web browser. The cookie may be saved by the browser and sent back to the same server with subsequent requests. An HTTP cookie is typically used to determine if two requests originate from the same browser, such as to keep a person logged in. For the stateless HTTP protocol, it remembers stateful information.

It's crucial to think about whether you need to correlate cookies or not when recording/scripting. Simply keep track of your business actions and observe if any web_add_cookie() calls were made to the website. If there are any calls, you must correlate it.

Cookies are of 2 types.
Client send cookies and 
Server send cookies.
If you need to correlate server side cookies,then you Identify the request for which the server sends the desired cookies.Then correlate the cookie.
--> If the value appears in header,use web_reg_save_param(""); In attributes use "Search=Headers".
-->> If the value appears in Cookies,use
web_reg_save_param_ex(“ParamName=Cookie”,“LB=Airshixtf245”,“RB=*!@>”,“Ordinal=1”,SEARCH_FILTERS,“Scope=COOKIES”,LAST);

If the cookie to be correlated is a Client side cookie generated by Java code then you need to understand the logic behind the cookie generation.Then try to write a C program that generate a similar cookie.


No comments: