51Testing软件测试论坛

标题: LoadRunner:Acessing the contents of cookies [打印本页]

作者: pcl2004_27    时间: 2006-10-25 13:58
标题: LoadRunner:Acessing the contents of cookies
Description

      When using LoadRunner with web applications one usually needs to correlate a session id or similar. Sometimes this is sent to the client via a cookie, but there is no way to read the cookies value with the LR cookie funktions.


Solution

      The web_reg_save_param funktion considers both header and body of the server's response, so here we go:

(cookie's name is "sessionid")

web_reg_save_param("sid","LB=Set-Cookie: jwssessionid=","RB=;",LAST);

Then the Parameter "sid" will contain the value.
If you need the other cookie fields, the best way to find the right parameters for web_reg_save_param is to log the data returned by the server (Run-Time-Settings->Log->Extended Log->data returned by server) and check the header.




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2