I am facing a problem about cookie usage please give your suggestions.
In my script I am accessing certain URLS, and after recording it has recorded a static cookie
CONSTANT S_cookie_3_0 = "logoncookie=cookieid:2gWuBgKNKBQ=<>" &
and below in the script it is setting logoncookie as
Load Response_Info Header on 3 &
Into cookie_3_0 &
But in the script everywhere the logon cookie is passed as static cookie (i.e. "S_cookie_3_0" )
So ideally I should replace all the occurence of the static cookie "S_cookie_3_0" to "cookie_3_0" but even if I do not replace the static cookie then also the script is working fine.
As per me the script should fail, but it is not failing, Please let me know if anyone has something to share
It depends a lot on how your server is configured to handle/generate cookies. Your approach of replacing the static cookies with the dynamic ones is perfect.
<ul type="square">[*]Your cookie contains a 'cookieexpiry'. This might mean that this cookie is valid till some instant of time. So if you play your script back say after 'n' mnts/hrs/days with the static cookie, you might see the error you expected.[*]Again, if the cookie was generated based on some encryption of userID/password combination, then you might be using the same for every session of that user.[/list]I am speaking here w/o any knowledge of the application you are testing on and I might be wrong. The development team is the best party to approach for inquiring about the cookie mechanism.
A question here: Is the hard-coded value for S_cookie_3_0 the same as the one you are capturing for cookie_3_0?
About cookie generation:
Each time the user logs in a new cookie is generated. So for each iteraion script follows the following pattern
Hits the primary url -> Logging process -> generates a cookie, this cookie is reffered as cookie_3_0 in the above discussion, so it should be present in the script wherever login cookie is required
And the value of Static cookie i.e "S_cookie_3_0" is different from cookie_3_0.
I am not able to understand why the static cookie is working in every iteration, well I will consult Dev team for more clarification,