51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

查看: 3471|回复: 6
打印 上一主题 下一主题

[原创] loadrunner动态数据获取

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2010-4-16 17:40:14 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
Action()
{

        lr_think_time(16);

        web_url("l_3.jpg",
                "URL=http://61.190.16.10:7001/syzw/commons/menu/images/menu/l_3.jpg",
                "Resource=1",
                "RecContentType=image/jpeg",
                "Referer=http://61.190.16.10:7001/syzw/main/menu.jsp",
                "Snapshot=t5.inf",
                LAST);


        web_url("index.jsp",
                "URL=http://61.190.16.10:7001/syzw/case/index.jsp",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=http://61.190.16.10:7001/syzw/loginOnAction.do;jsessionid={JSESSIONID2}",
                "Snapshot=t6.inf",
                "Mode=HTML",
                EXTRARES,
                "Url=../commons/tabcontrol/images/tou.gif", ENDITEM,
                "Url=../styles/images/tab_selected_left_bk2.gif", "Referer=http://61.190.16.10:7001/syzw/case/receive/receive.jsp", ENDITEM,
                "Url=../styles/images/tab_selected_right_bk2.gif", "Referer=http://61.190.16.10:7001/syzw/case/receive/receive.jsp", ENDITEM,
                "Url=../e3/tree/ext/resources/images/default/dd/drop-no.gif", "Referer=http://61.190.16.10:7001/syzw/serviceItemAction.do?dispatch=getServTreeByDept&deptId=164&lian=1", ENDITEM,
                "Url=../e3/tree/ext/resources/images/default/s.gif", "Referer=http://61.190.16.10:7001/syzw/serviceItemAction.do?dispatch=getServTreeByDept&deptId=164&lian=1", ENDITEM,
                "Url=../e3/tree/ext/resources/images/default/tree/folder.gif", "Referer=http://61.190.16.10:7001/syzw/serviceItemAction.do?dispatch=getServTreeByDept&deptId=164&lian=1", ENDITEM,
                "Url=../e3/tree/ext/resources/images/default/tree/elbow.gif", "Referer=http://61.190.16.10:7001/syzw/serviceItemAction.do?dispatch=getServTreeByDept&deptId=164&lian=1", ENDITEM,
                "Url=../e3/tree/ext/resources/images/default/tree/elbow-plus.gif", "Referer=http://61.190.16.10:7001/syzw/serviceItemAction.do?dispatch=getServTreeByDept&deptId=164&lian=1", ENDITEM,
                "Url=../e3/tree/ext/resources/images/default/tree/elbow-end.gif", "Referer=http://61.190.16.10:7001/syzw/serviceItemAction.do?dispatch=getServTreeByDept&deptId=164&lian=1", ENDITEM,
                "Url=../e3/tree/ext/resources/images/default/tree/elbow-end-minus.gif", "Referer=http://61.190.16.10:7001/syzw/serviceItemAction.do?dispatch=getServTreeByDept&deptId=164&lian=1", ENDITEM,
                "Url=../e3/tree/ext/resources/images/default/tree/folder-open.gif", "Referer=http://61.190.16.10:7001/syzw/serviceItemAction.do?dispatch=getServTreeByDept&deptId=164&lian=1", ENDITEM,
                "Url=../e3/tree/ext/resources/images/default/tree/leaf.gif", "Referer=http://61.190.16.10:7001/syzw/serviceItemAction.do?dispatch=getServTreeByDept&deptId=164&lian=1", ENDITEM,
                LAST);

        lr_think_time(4);


        web_url("serviceItemAction.do",
                "URL=http://61.190.16.10:7001/syzw/serviceItemAction.do?dispatch=setUpForInsertOrUpdate&servId=603&deptId=164&s=2&lian=1",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=http://61.190.16.10:7001/syzw/case/receive/receive.jsp",
                "Snapshot=t7.inf",
                "Mode=HTML",
                LAST);

        web_url("caseAction.do",
                "URL=http://61.190.16.10:7001/syzw/caseAction.do?dispatch=setUpForInsertOrUpdate&yizhangjieType=0&yizhangjieName=&deptId=164&servId=603",
                "Resource=0",
                "RecContentType=text/html",
                "Referer=http://61.190.16.10:7001/syzw/case/receive/receive.jsp",
                "Snapshot=t8.inf",
                "Mode=HTML",
                EXTRARES,
                "Url=commons/button/images/button_save.gif", "Referer=http://61.190.16.10:7001/syzw/caseAction.do?dispatch=setUpForInsertOrUpdate&yizhangjieType=0&yizhangjieName=&deptId=164&servId=603", ENDITEM,
                "Url=images/tp.gif", "Referer=http://61.190.16.10:7001/syzw/caseAction.do?dispatch=setUpForInsertOrUpdate&yizhangjieType=0&yizhangjieName=&deptId=164&servId=603", ENDITEM,
                LAST);


        lr_start_transaction("add");

        lr_think_time(15);

        web_submit_data("caseAction.do_2",
                "Action=http://61.190.16.10:7001/syzw/caseAction.do?status=&logCode=30&contractor=",
                "Method=POST",
                "RecContentType=text/html",
                "Referer=http://61.190.16.10:7001/syzw/caseAction.do?dispatch=setUpForInsertOrUpdate&yizhangjieType=0&yizhangjieName=&deptId=164&servId=603",
                "Snapshot=t9.inf",
                "Mode=HTML",
                ITEMDATA,
                "Name=org.apache.struts.taglib.html.TOKEN", "Value=f60108b2947fc07982d090b5106695be", ENDITEM,
                "Name=dispatch", "Value=insertOrUpdate", ENDITEM,
                "Name=caseBean.caseId", "Value=0", ENDITEM,
                "Name=caseBean.caseNo", "Value=", ENDITEM,
                "Name=caseBean.caseFeeFlag", "Value=否", ENDITEM,
                "Name=caseBean.caseServiceItemId", "Value=603", ENDITEM,
                "Name=caseBean.caseDeptId", "Value=164", ENDITEM,
                "Name=caseBean.caseFrom", "Value=", ENDITEM,
                "Name=caseBean.caseSupplyTimes", "Value=0", ENDITEM,
                "Name=caseBean.servDayByWarn", "Value=0", ENDITEM,
                "Name=caseBean.servPromiseDay", "Value=0", ENDITEM,
                "Name=caseBean.caseWarnDate", "Value=", ENDITEM,
                "Name=caseBean.casePromiseDate", "Value=", ENDITEM,
                "Name=caseBean.caseApproveFlag", "Value=是", ENDITEM,
                "Name=caseBean.caseTypeId", "Value=151", ENDITEM,
                "Name=caseBean.caseCertFlag", "Value=否", ENDITEM,
                "Name=caseBean.caseReceiver", "Value=901", ENDITEM,
                "Name=caseBean.workflowTemplate", "Value=", ENDITEM,
                "Name=caseBean.isAssistant", "Value=否", ENDITEM,
                "Name=caseBean.yizhangjieType", "Value=0", ENDITEM,
                "Name=caseBean.caseCheckFlag", "Value=是", ENDITEM,
                "Name=caseBean.isCheck", "Value=", ENDITEM,
                "Name=caseBean.isApprove", "Value=", ENDITEM,
                "Name=oper", "Value=", ENDITEM,
                "Name=caseBean.caseAppType", "Value=单位", ENDITEM,
                "Name=caseBean.caseApplicant", "Value=111", ENDITEM,
                "Name=get1", "Value=", ENDITEM,
                "Name=get2", "Value=", ENDITEM,
                "Name=caseBean.yizhangjieName", "Value=", ENDITEM,
                "Name=caseBean.caseServiceItemName", "Value=企业年检", ENDITEM,
                "Name=caseBean.caseTypeName", "Value=即办件", ENDITEM,
                "Name=caseBean.applicantID", "Value=", ENDITEM,
                "Name=caseBean.legalRepresentative", "Value=", ENDITEM,
                "Name=caseBean.caseLinkMan", "Value=", ENDITEM,
                "Name=caseBean.caseLinkPhone", "Value=", ENDITEM,
                "Name=caseBean.caseAddress", "Value=", ENDITEM,
                "Name=caseBean.caseEmail", "Value=", ENDITEM,
                "Name=caseBean.caseMobile", "Value=", ENDITEM,
                "Name=caseBean.payinfo.payBankId", "Value=", ENDITEM,
                "Name=selFee", "Value=isFee", ENDITEM,
                "Name=caseBean.caseNumber", "Value=1", ENDITEM,
                "Name=caseBean.caseStatusId", "Value=238", ENDITEM,
                "Name=caseBean.caseRemark", "Value=xxxxxxxxxx", ENDITEM,
                "Name=update", "Value=</SPAN>\r\n<DIV></DIV>", ENDITEM,
                EXTRARES,
                "Url=commons/button/images/button_null1.gif", "Referer=http://61.190.16.10:7001/syzw/caseAction.do?status=&logCode=30&contractor=", ENDITEM,
                "Url=commons/button/images/button_null2.gif", "Referer=http://61.190.16.10:7001/syzw/caseAction.do?status=&logCode=30&contractor=", ENDITEM,
                LAST);

        lr_end_transaction("add",LR_AUTO);


以上录制的脚本中,其中"Name=org.apache.struts.taglib.html.TOKEN", "Value=f60108b2947fc07982d090b5106695be"里面的f60108b2947fc07982d090b5106695be如何通过web_reg_save_param来获取,麻烦各位大侠帮帮忙
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

该用户从未签到

2#
发表于 2010-4-16 17:57:34 | 只看该作者
web_reg_save_param("id","LB=Name=org.apache.struts.taglib.html.TOKEN\", \"Value=","RB=\", ENDITEM","Search=body","Ord=1",
LAST);
(记得加转义字符。。)
回复 支持 反对

使用道具 举报

该用户从未签到

3#
 楼主| 发表于 2010-4-17 15:25:39 | 只看该作者

回复 2# 的帖子

这个方法好像不行,web_reg_save_param的位置放哪?
回复 支持 反对

使用道具 举报

  • TA的每日心情
    慵懒
    2019-9-27 12:46
  • 签到天数: 179 天

    连续签到: 1 天

    [LV.7]测试师长

    4#
    发表于 2010-4-17 15:53:08 | 只看该作者
    web_reg_save_param的位置和左右边界值要到server response里去查一下才能确定。

    根据你这个脚本,我猜测位置应该是在 web_url("caseAction.do", 或者web_url("serviceItemAction.do", 的前面;左右边界值不能根据脚本里显示的内容来定,要根据server response里的内容来定。

    [ 本帖最后由 saharaqs 于 2010-4-17 15:55 编辑 ]
    回复 支持 反对

    使用道具 举报

    该用户从未签到

    5#
     楼主| 发表于 2010-4-17 15:56:58 | 只看该作者
    问题解决了,是位置不对的问题,谢谢啦
    回复 支持 反对

    使用道具 举报

    该用户从未签到

    6#
    发表于 2010-4-18 15:28:51 | 只看该作者
    ding !
    回复 支持 反对

    使用道具 举报

    该用户从未签到

    7#
    发表于 2010-4-23 09:22:09 | 只看该作者
    放在表单提交前
    回复 支持 反对

    使用道具 举报

    本版积分规则

    关闭

    站长推荐上一条 /1 下一条

    小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

    GMT+8, 2024-11-16 21:11 , Processed in 0.069467 second(s), 26 queries .

    Powered by Discuz! X3.2

    © 2001-2024 Comsenz Inc.

    快速回复 返回顶部 返回列表