LoadRunner之用户自定义数据采集
作者:网络转载 发布时间:[ 2013/3/4 10:32:56 ] 推荐标签:
例二:
Action()
{
long instance_id;
web_set_max_html_param_len("1024");
web_reg_save_param("JSESSIONID5",
"LB/IC=jsessionid=",
"RB/IC="",
"Ord=11",
"Search=body",
"RelFrameId=1",
LAST);
web_url("web",
"URL=http://172.19.201.188:7001/web/",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t1.inf",
"Mode=HTML",
EXTRARES,
"Url=images/login/3.swf", ENDITEM,
LAST);
web_reg_find("Search=Body",
"SaveCount=times",
"Text={username}",
LAST);
web_submit_data("logon.do;jsessionid=schvTJJpR1BCBYYv9hhhn6k5zMwzZJ7JtTp5yPKvjBm6QpJv1DsN!-1783399523",
"Action=http://172.19.201.188:7001/web/pf/authentication/logon.do;jsessionid={JSESSIONID5}",
"Method=POST",
"TargetFrame=_parent",
"RecContentType=text/html",
"Referer=http://172.19.201.188:7001/web/",
"Snapshot=t2.inf",
"Mode=HTML",
ITEMDATA,
"Name=kind", "Value=1", ENDITEM,
"Name=clientIPAddr", "Value=", ENDITEM,
"Name=clientMacAddr", "Value=", ENDITEM,
"Name=clientMachineName", "Value=", ENDITEM,
"Name=username", "Value={username}", ENDITEM,
"Name=password", "Value=1", ENDITEM,
LAST);
//lr_output_message("count=%d",atoi(lr_eval_string ("{times}")));
if(atoi(lr_eval_string ("{times}"))>0) {
instance_id = lr_start_transaction_instance("withresponse", 0);
web_url("close.html",
"URL=http://172.19.201.188:7001/web/pf/close.html",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t3.inf",
"Mode=HTML",
LAST);
web_url("redirectURL.jsp",
"URL=http://172.19.201.188:7001/web/pf/redirectURL.jsp?redirect=true&kind=logon&U=1309938062295",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t4.inf",
"Mode=HTML",
LAST);
web_url("frameWork.jsp",
"URL=http://172.19.201.188:7001/web/pf/webdesk/frameWork.jsp",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t5.inf",
"Mode=HTML",
EXTRARES,
"Url=/web/styles/default/frame/images/lineBg.gif", "Referer=http://172.19.201.188:7001/web/pf/webdesk/top/getInfobar.do", ENDITEM,
"Url=/web/styles/default/frame/images/version.gif", "Referer=http://172.19.201.188:7001/web/pf/webdesk/top/getInfobar.do", ENDITEM,
"Url=/web/styles/default/frame/images/button-Table.gif", "Referer=http://172.19.201.188:7001/web/pf/webdesk/top/getInfobar.do", ENDITEM,
"Url=/web/styles/default/frame/images/button-info.gif", "Referer=http://172.19.201.188:7001/web/pf/webdesk/top/getInfobar.do", ENDITEM,
"Url=/web/styles/default/frame/images/button-login.gif", "Referer=http://172.19.201.188:7001/web/pf/webdesk/top/getInfobar.do", ENDITEM,
"Url=/web/styles/default/images/logo_default.gif", "Referer=http://172.19.201.188:7001/web/pf/webdesk/top/getNaviMenu.do", ENDITEM,
"Url=/web/styles/default/frame/images/linemid.gif", "Referer=http://172.19.201.188:7001/web/pf/webdesk/split.jsp", ENDITEM,
"Url=/web/styles/default/frame/images/button-help.gif", "Referer=http://172.19.201.188:7001/web/pf/webdesk/top/getInfobar.do", ENDITEM,
"Url=/web/styles/default/frame/images/ArrowLeft.gif", "Referer=http://172.19.201.188:7001/web/pf/webdesk/split.jsp", ENDITEM,
"Url=/web/styles/default/images/popup_bg_menu.gif", "Referer=http://172.19.201.188:7001/web/pf/webdesk/mainMessage.jsp?U=", ENDITEM,
"Url=/web/styles/default/frame/images/line1.gif", "Referer=http://172.19.201.188:7001/web/pf/webdesk/top/getNaviMenu.do", ENDITEM,
"Url=/web/styles/default/frame/images/tabBg.gif", "Referer=http://172.19.201.188:7001/web/pf/webdesk/top/getNaviMenu.do", ENDITEM,
"Url=/web/styles/default/frame/images/line.gif", "Referer=http://172.19.201.188:7001/web/pf/webdesk/top/getNaviMenu.do", ENDITEM,
"Url=/web/styles/default/frame/images/naviMenuselect.gif", "Referer=http://172.19.201.188:7001/web/pf/webdesk/top/getNaviMenu.do", ENDITEM,
"Url=/web/styles/default/frame/images/lineleft.gif", "Referer=http://172.19.201.188:7001/web/pf/webdesk/left/getMenuFromXml.do", ENDITEM,
"Url=/web/styles/default/frame/images/buttonOff.gif", "Referer=http://172.19.201.188:7001/web/pf/webdesk/left/getMenuFromXml.do", ENDITEM,
"Url=menu/images/item/big/icon1.gif", "Referer=http://172.19.201.188:7001/web/pf/webdesk/left/getMenuFromXml.do", ENDITEM,
"Url=menu/images/item/big/icon4.gif", "Referer=http://172.19.201.188:7001/web/pf/webdesk/left/getMenuFromXml.do", ENDITEM,
"Url=menu/images/item/big/icon3.gif", "Referer=http://172.19.201.188:7001/web/pf/webdesk/left/getMenuFromXml.do", ENDITEM,
"Url=menu/images/item/big/icon2.gif", "Referer=http://172.19.201.188:7001/web/pf/webdesk/left/getMenuFromXml.do", ENDITEM,
"Url=/web/styles/default/frame/images/buttonOn.gif", "Referer=http://172.19.201.188:7001/web/pf/webdesk/left/getMenuFromXml.do", ENDITEM,
"Url=/web/styles/default/frame/images/buttonBg.gif", "Referer=http://172.19.201.188:7001/web/pf/webdesk/left/getMenuFromXml.do", ENDITEM,
"Url=system/webmessageshow.jar", "Referer=", ENDITEM,
LAST);
web_url("commonAction.do",
"URL=http://172.19.201.188:7001/web/cc/core/common/commonAction.do?action=ajaxRequest&ajaxRequestClass=epm.cc.core.web.common.action.AutoRefreshSessionAjaxRequest&ccuserNo=9001",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Referer=http://172.19.201.188:7001/web/pf/webdesk/top/navimenu.jsp",
"Snapshot=t6.inf",
"Mode=HTML",
LAST);
lr_user_data_point_instance("username",
atoi(lr_eval_string("{username}")), instance_id);
lr_end_transaction_instance(instance_id, LR_PASS);
}
else
lr_end_transaction_instance(instance_id, LR_FAIL);
return 0;
}
相关推荐
更新发布
功能测试和接口测试的区别
2023/3/23 14:23:39如何写好测试用例文档
2023/3/22 16:17:39常用的选择回归测试的方式有哪些?
2022/6/14 16:14:27测试流程中需要重点把关几个过程?
2021/10/18 15:37:44性能测试的七种方法
2021/9/17 15:19:29全链路压测优化思路
2021/9/14 15:42:25性能测试流程浅谈
2021/5/28 17:25:47常见的APP性能测试指标
2021/5/8 17:01:11