打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
LR 事务+集合点+参数化+检查点

lr_rendezvous("login"); /*集合点*/

 lr_start_transaction("login"); /*事务开始*/

 web_reg_find("Text=CACname","SaveCount=num","Search=Body",LAST); /*检查点*/

 web_submit_form("VerifyServlet",
  "Snapshot=t2.inf",
  ITEMDATA,
  "Name=username", "Value={user}", ENDITEM,
  "Name=password", "Value=admin", ENDITEM,
  "Name=Button1", "Value=登  录", ENDITEM,
  EXTRARES,
  "URL=resources/menu.json?_dc=1331175664185&page=1&start=0&limit=25&filter=%5B%7B%22property%22%3A%22type%22%2C%22value%22%3A%22base%22%7D%5D", "Referer=http://localhost/cacms/main.jsp", ENDITEM,
  "URL=resources/menu.json?_dc=1331175664232&page=1&start=0&limit=25&filter=%5B%7B%22property%22%3A%22type%22%2C%22value%22%3A%22data%22%7D%5D", "Referer=http://localhost/cacms/main.jsp", ENDITEM,
  "URL=resources/menu.json?_dc=1331175664232&page=1&start=0&limit=25&filter=%5B%7B%22property%22%3A%22type%22%2C%22value%22%3A%22sys%22%7D%5D", "Referer=http://localhost/cacms/main.jsp", ENDITEM,
  "URL=ext4/resources/themes/images/default/tip/tip-sides.gif", "Referer=http://localhost/cacms/main.jsp", ENDITEM,
  "URL=ext4/resources/themes/images/default/tip/tip-corners.gif", "Referer=http://localhost/cacms/main.jsp", ENDITEM,
  "URL=ext4/resources/themes/images/default/toolbar/toolbar-default-bg.gif", "Referer=http://localhost/cacms/main.jsp", ENDITEM,
  "URL=images/logo.PNG", "Referer=http://localhost/cacms/main.jsp", ENDITEM,
  "URL=images/home.png", "Referer=http://localhost/cacms/main.jsp", ENDITEM,
  "URL=images/user_suit.gif", "Referer=http://localhost/cacms/main.jsp", ENDITEM,
  "URL=ext4/resources/themes/images/default/grid/refresh.gif", "Referer=http://localhost/cacms/main.jsp", ENDITEM,
  "URL=images/favorite.png", "Referer=http://localhost/cacms/main.jsp", ENDITEM,
  "URL=images/global.png", "Referer=http://localhost/cacms/main.jsp", ENDITEM,
  "URL=images/key.gif", "Referer=http://localhost/cacms/main.jsp", ENDITEM,
  "URL=ext4/resources/themes/images/default/grid/hmenu-unlock.png", "Referer=http://localhost/cacms/main.jsp", ENDITEM,
  "URL=images/help.png", "Referer=http://localhost/cacms/main.jsp", ENDITEM,
  "URL=ext4/resources/themes/images/default/panel-header/panel-header-default-top-bg.gif", "Referer=http://localhost/cacms/main.jsp", ENDITEM,
  "URL=ext4/resources/themes/images/default/tools/tool-sprites.gif", "Referer=http://localhost/cacms/main.jsp", ENDITEM,
  "URL=ext4/resources/themes/images/default/util/splitter/mini-left.gif", "Referer=http://localhost/cacms/main.jsp", ENDITEM,
  "URL=images/list-items.gif", "Referer=http://localhost/cacms/main.jsp", ENDITEM,
  "URL=ext4/resources/themes/images/default/tab/tab-default-top-active-bg.gif", "Referer=http://localhost/cacms/main.jsp", ENDITEM,
  "URL=ext4/resources/themes/images/default/tab/tab-default-top-active-corners.gif", "Referer=http://localhost/cacms/main.jsp", ENDITEM,
  "URL=ext4/resources/themes/images/default/tab/tab-default-top-active-sides.gif", "Referer=http://localhost/cacms/main.jsp", ENDITEM,
  "URL=images/homepage.png", "Referer=http://localhost/cacms/main.jsp", ENDITEM,
  "URL=ext4/resources/themes/images/default/grid/column-header-bg.gif", "Referer=http://localhost/cacms/main.jsp", ENDITEM,
  "URL=ext4/resources/themes/images/default/dd/drop-no.gif", "Referer=http://localhost/cacms/main.jsp", ENDITEM,
  "URL=images/green.png", "Referer=http://localhost/cacms/main.jsp", ENDITEM,
  "URL=images/red.png", "Referer=http://localhost/cacms/main.jsp", ENDITEM,
  "URL=ext4/resources/themes/images/default/grid/grid3-hd-btn.gif", "Referer=http://localhost/cacms/main.jsp", ENDITEM,
  "URL=ext4/resources/themes/images/default/grid/sort_asc.gif", "Referer=http://localhost/cacms/main.jsp", ENDITEM,
  "URL=ext4/resources/themes/images/default/grid/column-header-over-bg.gif", "Referer=http://localhost/cacms/main.jsp", ENDITEM,
  "URL=images/yellow.png", "Referer=http://localhost/cacms/main.jsp", ENDITEM,
  "URL=ext4/resources/themes/images/default/tab/tab-default-top-bg.gif", "Referer=http://localhost/cacms/main.jsp", ENDITEM,
  "URL=ext4/resources/themes/images/default/tab/tab-default-top-corners.gif", "Referer=http://localhost/cacms/main.jsp", ENDITEM,
  "URL=ext4/resources/themes/images/default/tab/tab-default-top-sides.gif", "Referer=http://localhost/cacms/main.jsp", ENDITEM,
  "URL=images/templates.png", "Referer=http://localhost/cacms/main.jsp", ENDITEM,
  "URL=ext4/resources/themes/images/default/tab/tab-default-close.gif", "Referer=http://localhost/cacms/main.jsp", ENDITEM,
  "URL=images/add.png", "Referer=http://localhost/cacms/main.jsp", ENDITEM,
  "URL=images/delete.png", "Referer=http://localhost/cacms/main.jsp", ENDITEM,
  "URL=ext4/resources/themes/images/default/btn/btn-default-toolbar-small-disabled-sides.gif", "Referer=http://localhost/cacms/main.jsp", ENDITEM,
  "URL=ext4/resources/themes/images/default/btn/btn-default-toolbar-small-disabled-corners.gif", "Referer=http://localhost/cacms/main.jsp", ENDITEM,
  "URL=ext4/resources/themes/images/default/btn/btn-default-toolbar-small-over-sides.gif", "Referer=http://localhost/cacms/main.jsp", ENDITEM,
  "URL=ext4/resources/themes/images/default/btn/btn-default-toolbar-small-over-bg.gif", "Referer=http://localhost/cacms/main.jsp", ENDITEM,
  "URL=ext4/resources/themes/images/default/btn/btn-default-toolbar-small-over-corners.gif", "Referer=http://localhost/cacms/main.jsp", ENDITEM,
  "URL=ext4/resources/themes/images/default/btn/btn-default-toolbar-small-pressed-sides.gif", "Referer=http://localhost/cacms/main.jsp", ENDITEM,
  "URL=ext4/resources/themes/images/default/btn/btn-default-toolbar-small-pressed-bg.gif", "Referer=http://localhost/cacms/main.jsp", ENDITEM,
  "URL=ext4/resources/themes/images/default/btn/btn-default-toolbar-small-pressed-corners.gif", "Referer=http://localhost/cacms/main.jsp", ENDITEM,
  "URL=ext4/resources/themes/images/default/btn/btn-default-toolbar-small-focus-sides.gif", "Referer=http://localhost/cacms/main.jsp", ENDITEM,
  "URL=ext4/resources/themes/images/default/btn/btn-default-toolbar-small-focus-bg.gif", "Referer=http://localhost/cacms/main.jsp", ENDITEM,
  "URL=ext4/resources/themes/images/default/btn/btn-default-toolbar-small-focus-corners.gif", "Referer=http://localhost/cacms/main.jsp", ENDITEM,
  "URL=ext4/resources/themes/images/default/form/text-bg.gif", "Referer=http://localhost/cacms/main.jsp", ENDITEM,
  "URL=ext4/resources/themes/images/default/form/exclamation.gif", "Referer=http://localhost/cacms/main.jsp", ENDITEM,
  "URL=ext4/resources/themes/images/default/form-invalid-tip/form-invalid-tip-default-sides.gif", "Referer=http://localhost/cacms/main.jsp", ENDITEM,
  "URL=ext4/resources/themes/images/default/form-invalid-tip/form-invalid-tip-default-corners.gif", "Referer=http://localhost/cacms/main.jsp", ENDITEM,
  "URL=ext4/resources/themes/images/default/form/trigger.gif", "Referer=http://localhost/cacms/main.jsp", ENDITEM,
  "URL=ext4/resources/themes/images/default/panel/panel-default-framed-corners.gif", "Referer=http://localhost/cacms/main.jsp", ENDITEM,
  "URL=ext4/resources/themes/images/default/btn/btn-default-small-bg.gif", "Referer=http://localhost/cacms/main.jsp", ENDITEM,
  "URL=ext4/resources/themes/images/default/btn/btn-default-small-sides.gif", "Referer=http://localhost/cacms/main.jsp", ENDITEM,
  "URL=ext4/resources/themes/images/default/btn/btn-default-small-corners.gif", "Referer=http://localhost/cacms/main.jsp", ENDITEM,
  "URL=ext4/resources/themes/images/default/btn/btn-default-small-over-bg.gif", "Referer=http://localhost/cacms/main.jsp", ENDITEM,
  "URL=ext4/resources/themes/images/default/btn/btn-default-small-over-sides.gif", "Referer=http://localhost/cacms/main.jsp", ENDITEM,
  "URL=ext4/resources/themes/images/default/btn/btn-default-small-over-corners.gif", "Referer=http://localhost/cacms/main.jsp", ENDITEM,
  "URL=ext4/resources/themes/images/default/btn/btn-default-small-pressed-sides.gif", "Referer=http://localhost/cacms/main.jsp", ENDITEM,
  "URL=ext4/resources/themes/images/default/btn/btn-default-small-pressed-corners.gif", "Referer=http://localhost/cacms/main.jsp", ENDITEM,
  "URL=ext4/resources/themes/images/default/btn/btn-default-small-pressed-bg.gif", "Referer=http://localhost/cacms/main.jsp", ENDITEM,
  "URL=ext4/resources/themes/images/default/btn/btn-default-small-focus-sides.gif", "Referer=http://localhost/cacms/main.jsp", ENDITEM,
  "URL=ext4/resources/themes/images/default/btn/btn-default-small-focus-bg.gif", "Referer=http://localhost/cacms/main.jsp", ENDITEM,
  "URL=ext4/resources/themes/images/default/btn/btn-default-small-focus-corners.gif", "Referer=http://localhost/cacms/main.jsp", ENDITEM,
  "URL=ext4/resources/themes/images/default/grid/dirty.gif", "Referer=http://localhost/cacms/main.jsp", ENDITEM,
  "URL=ext4/resources/themes/images/default/grid/loading.gif", "Referer=http://localhost/cacms/main.jsp", ENDITEM,
  LAST);

 web_custom_request("TimeServlet",
  "URL=http://localhost/cacms/TimeServlet",
  "Method=POST",
  "Resource=0",
  "RecContentType=text/html",
  "Referer=http://localhost/cacms/main.jsp",
  "Snapshot=t3.inf",
  "Mode=HTML",
  "EncType=",
  LAST);

 

 web_url("Virtual_listServlet",
  "URL=http://localhost/cacms/Virtual_listServlet?type=read&stationno=dadeb&_dc=1331175665339&page=1&start=0&limit=25",
  "Resource=0",
  "RecContentType=text/html",
  "Referer=http://localhost/cacms/main.jsp",
  "Snapshot=t4.inf",
  "Mode=HTML",
  LAST);

 web_url("SensorinfoServlet",
  "URL=http://localhost/cacms/SensorinfoServlet?type=read&stationno=dadeb&_dc=1331175665371&page=1&start=0&limit=25&sort=%5B%7B%22property%22%3A%22sensorname%22%2C%22direction%22%3A%22ASC%22%7D%5D",
  "Resource=0",
  "RecContentType=text/html",
  "Referer=http://localhost/cacms/main.jsp",
  "Snapshot=t6.inf",
  "Mode=HTML",
  LAST);

 web_url("CagServlet",
  "URL=http://localhost/cacms/CagServlet?type=read&stationno=dadeb&_dc=1331175665339&page=1&start=0&limit=25",
  "Resource=0",
  "Referer=http://localhost/cacms/main.jsp",
  "Snapshot=t5.inf",
  "Mode=HTML",
  LAST);

 lr_end_transaction("login", LR_AUTO); /*事务结束*/

 lr_log_message("用户名:%s", lr_eval_string("{user}")); /*日志输出*/

 if(strcmp(lr_eval_string("{num}"),"0")==0) /*将num与0比较,如果num=0,则返回值==0,则为真,执行登录失败语句;如果num!=0,则返回值!=0,执行登录成功语句*/
  lr_log_message("登录失败!");
 else
  lr_log_message("登录成功!");
 
ps:那如果num<0呢、、、、、
 
可以换成语句:
if(atoi(lr_eval_string("{num}"))==0)
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
loadrunner支持https协议的操作方法
LoadRunner脚本解释分析
一道Loadrunner笔试题
lr文件下载脚本
Loadrunner思考时间
loadrunner中web
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服