51Testing软件测试论坛
标题:
如何把脚本里的sessionID参数化?
[打印本页]
作者:
apl137
时间:
2006-10-8 10:46
标题:
如何把脚本里的sessionID参数化?
测试WEB时,用loadrunner的visual user generator录制基本用户脚本.如下:请问要什么才能把
sessionID参数化,使脚本在过了session的时间后还能运行.
vuser_init()
{
web_set_max_html_param_len("1024");
/* Registering parameter(s) from source task id 7
// {JSESSIONID2} = "A841370DA4B6568309B0CB75EADF8765"
// */
web_reg_save_param("JSESSIONID2",
"LB/IC=jsessionid=",
"RB/IC=\"",
"Ord=1",
"Search=body",
"RelFrameId=1",
LAST);
web_url("shss",
"URL=http://90.0.3.99:8080/shss",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t1.inf",
"Mode=HTML",
EXTRARES,
"Url=/shss/images/botton/dl_1.gif", "Referer=http://90.0.3.99:8080/shss/", ENDITEM,
LAST);
lr_think_time(12);
web_submit_form("loginAction.do;jsessionid=A841370DA4B6568309B0CB75EADF8765",
"Snapshot=t2.inf",
ITEMDATA,
"Name=user", "Value=湘K01755", ENDITEM,
"Name=calletter", "Value=", ENDITEM,
"Name=password", "Value=1", ENDITEM,
EXTRARES,
"Url=images/botton/jbzl.gif", ENDITEM,
"Url=images/botton/azxp.gif", ENDITEM,
"Url=images/botton/fwtc.gif", ENDITEM,
"Url=images/botton/wsc_1.gif", ENDITEM,
"Url=images/botton/xptj.gif", ENDITEM,
"Url=images/botton/jfxx.gif", ENDITEM,
"Url=images/botton/wtfk_1.gif", ENDITEM,
"Url=images/botton/cljq_1.gif", ENDITEM,
"Url=images/botton/qfxx_1.gif", ENDITEM,
"Url=images/botton/rdhd_1.gif", ENDITEM,
"Url=images/botton/lx_1.gif", ENDITEM,
"Url=images/botton/tcdl_1.gif", ENDITEM,
"Url=images/top_4.jpg", ENDITEM,
"Url=images/right_4.gif", ENDITEM,
"Url=images/lift_9.jpg", ENDITEM,
"Url=images/right_12.gif", ENDITEM,
LAST);
return 0;
作者:
Zee
时间:
2006-10-8 12:57
是关联吧?
作者:
netldy
时间:
2006-10-8 15:16
???
你的脚本上面不是已经作好关联了么???怎么不使用???
把web_submit_form("loginAction.do;jsessionid=A841370DA4B6568309B0CB75EADF8765",
..............
中的A841370DA4B6568309B0CB75EADF8765换成{JSESSIONID2}不就OK了么?
你的好像是个交通的什么查询web,
那个湘K01755也要写成参数的吧?
作者:
apl137
时间:
2006-10-10 11:20
试一下
欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/)
Powered by Discuz! X3.2