|
因为项目需要,所以调查一下在Loadrunner中修改Cookie的值,然后再用这个值访问服务器。
本来以为比较简单,但是实际操作起来发现了一些问题。- Action()
- {
- web_add_cookie("AJSTAT_ok_times=1; DOMAIN=www.51testing.com");
- // web_add_cookie("cdb_sid=RPzwKT; DOMAIN=www.51testing.com");
- web_add_cookie("cdb_sid=ABCDE; DOMAIN=www.51testing.com");
- //我希望将把Cookie中的值,换成ABCDE,但是实际在回放的时候,看Request中的Cookie值还是RPzwKT,不知道为什么这个语句没有起作用。
- web_add_cookie("cdb_oldtopics=D81859D18877D; DOMAIN=www.51testing.com");
- web_add_cookie("cdb_visitedfid=67D69; DOMAIN=www.51testing.com");
- web_add_cookie("cdb_cookietime=2592000; DOMAIN=www.51testing.com");
- web_add_cookie("cdb_auth=TZCIjkqQ8k262YD8Ns3R%2FpDgq2JDBa2V6DaPZwl1ApG%2BntcqWDW1Mea%2F2EJgbF4; DOMAIN=www.51testing.com");
- web_add_cookie("cdb_smile=1D1; DOMAIN=www.51testing.com");
- web_add_auto_header("Accept-Language",
- "ja");
- web_add_cookie("AJSTAT_ok_times=2; DOMAIN=www.51testing.com");
- web_add_cookie("AJSTAT_ok_pages=1; DOMAIN=www.51testing.com");
- web_url("www.51testing.com",
- "URL=http://www.51testing.com/",
- "TargetFrame=",
- "Resource=0",
- "RecContentType=text/html",
- "Referer=",
- "Snapshot=t1.inf",
- "Mode=HTML",
- EXTRARES,
- "Url=http://www.51testing.net/index.swf", ENDITEM,
- "Url=/images/new/jymy.swf", ENDITEM,
- "Url=/images/new/mysearch.gif", ENDITEM,
- "Url=/images/new/com-susuo.gif", ENDITEM,
- "Url=http://ad.cn.doubleclick.net/dot.gif?[timestamp]", "Referer=http://www.51testing.com/images/new/jymy.swf", ENDITEM,
- "Url=/images/new/hotspace_bg.gif", ENDITEM,
- "Url=/images/new/searchL.gif", ENDITEM,
- "Url=/images/new/menu_hbg_l.gif", ENDITEM,
- "Url=/images/new/menu_hbg_r.gif", ENDITEM,
- "Url=/images/new/list_icon.gif", ENDITEM,
- "Url=/images/new/com-shang-gengxin.gif", ENDITEM,
- "Url=/images/new/com-shang-gengxin1.gif", ENDITEM,
- "Url=/images/new/menu_hbg.gif", ENDITEM,
- "Url=/images/new/com-luntan.gif", ENDITEM,
- "Url=/images/new/com-boke.gif", ENDITEM,
- "Url=/images/new/com-jingxuan.gif", ENDITEM,
- "Url=http://icon.ajiang.net/icon_9.gif", ENDITEM,
- "Url=/php/modpage/img/zixun.swf", ENDITEM,
- LAST);
- web_save_header(RESPONSE , "response val");
- web_save_header(REQUEST , "request val");
- web_url("go.asp",
- "URL=http://web.51.la/go.asp?svid=9&id=831631&tpages=1&ttimes=2&tzone=8&tcolor=32&sSize=1024,768&referrer=&vpage=http%3A//www.51testing.com/",
- "TargetFrame=",
- "Resource=0",
- "RecContentType=text/html",
- "Referer=http://www.51testing.com/",
- "Mode=HTML",
- LAST);
- lr_output_message("*********** response = %s","");
- lr_output_message("temp = %s", lr_eval_string("{response val}"));
- lr_output_message("*********** resquest = %s","");
- lr_output_message("temp1 = %s", lr_eval_string("{request val}"));
- return 0;
- }
复制代码 下面Request中的Cookie的值
Cookie: AJSTAT_ok_times=1; cdb_sid=RPzwKT; cdb_oldtopics=D81859D18877D; cdb_visitedfid=67D69; cdb_cookietime=2592000; cdb_auth=TZCIjkqQ8k262YD8Ns3R%2FpDgq2JDBa2V6DaPZwl1ApG%2BntcqWDW1Mea%2F2EJgbF4; cdb_smile=1D1
各位XDJM,如果谁知道原因,麻烦赐教。3Q
[ 本帖最后由 jilinzy 于 2007-11-2 16:21 编辑 ] |
|