51Testing软件测试论坛

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

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

查看: 1790|回复: 4
打印 上一主题 下一主题

[原创] LR参数化时遇到的问题

[复制链接]

该用户从未签到

跳转到指定楼层
1#
发表于 2011-9-1 14:33:53 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
下面两个需要做参数化,其中instoreHead.id代表数据库的对应instoreCode的ID,
"Name=instoreHead.id", "Value=74"---数据库中对应下面入库编号的ID,
"Name=instoreCode", "Value=201108RK0065"---入库编号,流水号
上面两个数据在执行脚本后会往数据库中新增对应的“201108RK0065”这条记录,对应的ID为:74。
我现在参数化上面两个数据,使用Data Wizard参数化入库编号,可是网上搜索一下,说用Data Wizard不能自动更新数据,这样的话我测试过程中就没有办法取到我最新增加的入库记录的编号了,那参数化对我的测试就起不到作用了,有什么办法能够自动更新,让我取到最新增加的那条记录的入库编号吗?谢谢诶
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

  • TA的每日心情
    奋斗
    2022-5-8 19:23
  • 签到天数: 137 天

    连续签到: 1 天

    [LV.7]测试师长

    2#
    发表于 2011-9-1 21:33:29 | 只看该作者
    要使用关联来实现
    回复 支持 反对

    使用道具 举报

    该用户从未签到

    3#
     楼主| 发表于 2011-9-7 10:26:09 | 只看该作者
    下面是全部脚本内容:

    web_url("loginAction.action",
      "URL=http://192.168.1.60:82/biology/loginAction.action",
      "Resource=0",
      "RecContentType=text/html",
      "Referer=",
      "Snapshot=t1.inf",
      "Mode=HTML",
      LAST);

    web_submit_form("loginAction.action;jsessionid=26F0B68273303DA35F8D4926F5E3ED33",
      "Snapshot=t2.inf",
      ITEMDATA,
      "Name=loginName", "Value=ADMIN", ENDITEM,
      "Name=loginPassword", "Value=ADMIN", ENDITEM,
      "Name=x", "Value=16", ENDITEM,
      "Name=y", "Value=8", ENDITEM,
      EXTRARES,
      "Url=image/folder.gif", "Referer=http://192.168.1.60:82/biology/Left.jsp", ENDITEM,
      "Url=image/base.gif", "Referer=http://192.168.1.60:82/biology/Left.jsp", ENDITEM,
      "Url=image/plus.gif", "Referer=http://192.168.1.60:82/biology/Left.jsp", ENDITEM,
      "Url=image/join.gif", "Referer=http://192.168.1.60:82/biology/Left.jsp", ENDITEM,
      "Url=image/page.gif", "Referer=http://192.168.1.60:82/biology/Left.jsp", ENDITEM,
      "Url=image/joinbottom.gif", "Referer=http://192.168.1.60:82/biology/Left.jsp", ENDITEM,
      "Url=image/plusbottom.gif", "Referer=http://192.168.1.60:82/biology/Left.jsp", ENDITEM,
      "Url=image/empty.gif", "Referer=http://192.168.1.60:82/biology/Left.jsp", ENDITEM,
      "Url=image/line.gif", "Referer=http://192.168.1.60:82/biology/Left.jsp", ENDITEM,
      "Url=image/folderopen.gif", "Referer=http://192.168.1.60:82/biology/Left.jsp", ENDITEM,
      "Url=image/minus.gif", "Referer=http://192.168.1.60:82/biology/Left.jsp", ENDITEM,
      LAST);

    web_url("Top.jsp",
      "URL=http://192.168.1.60:82/biology/Top.jsp",
      "Resource=0",
      "RecContentType=text/html",
      "Referer=http://192.168.1.60:82/biology/Main.jsp",
      "Snapshot=t4.inf",
      "Mode=HTML",
      LAST);

    web_url("showAddInstoreStraight.action",
      "URL=http://192.168.1.60:82/biology/bio/circulation/showAddInstoreStraight.action?modId=21&firstTime=yes",
      "Resource=0",
      "RecContentType=text/html",
      "Referer=http://192.168.1.60:82/biology/Left.jsp",
      "Snapshot=t5.inf",
      "Mode=HTML",
      EXTRARES,
      "Url=/biology/images/buttontwo.gif", "Referer=http://192.168.1.60:82/biology/bio/circulation/showAddInstoreStraight.action?modId=21&firstTime=yes", ENDITEM,
      LAST);

    web_custom_request("BacterinService.searchBacterins.dwr",
      "URL=http://192.168.1.60:82/biology/dwr/call/plaincall/BacterinService.searchBacterins.dwr",
      "Method=POST",
      "Resource=0",
      "RecContentType=text/javascript",
      "Referer=http://192.168.1.60:82/biology/bio/circulation/showInStoreList.action",
      "Snapshot=t7.inf",
      "Mode=HTML",
      "EncType=text/plain",
      "Body=callCount=1\npage=/biology/bio/circulation/showInStoreList.action\nhttpSessionId=26F0B68273303DA35F8D4926F5E3ED33\nscriptSessionId=8A2516F349C12996BDBEA97370E70554350\nc0-scriptName=BacterinService\nc0-methodName=searchBacterins\nc0-id=0\nc0-e1=string:\nc0-param0=Object_Object:{bacterinSort:reference:c0-e1}\nbatchId=0\n",
      LAST);

    web_custom_request("CascadeSelectService.basePurveyUnitSelectFactory.dwr",
      "URL=http://192.168.1.60:82/biology/dwr/call/plaincall/CascadeSelectService.basePurveyUnitSelectFactory.dwr",
      "Method=POST",
      "Resource=0",
      "RecContentType=text/javascript",
      "Referer=http://192.168.1.60:82/biology/bio/circulation/showInStoreList.action",
      "Snapshot=t8.inf",
      "Mode=HTML",
      "EncType=text/plain",
      "Body=callCount=1\npage=/biology/bio/circulation/showInStoreList.action\nhttpSessionId=26F0B68273303DA35F8D4926F5E3ED33\nscriptSessionId=8A2516F349C12996BDBEA97370E70554350\nc0-scriptName=CascadeSelectService\nc0-methodName=basePurveyUnitSelectFactory\nc0-id=0\nc0-e1=string:1\nc0-e2=string:\nc0-e3=string:1\nc0-param0=Object_Object:{organId:reference:c0-e1, purveyId:reference:c0-e2, extraOption:reference:c0-e3}\nbatchId=1\n",
      LAST);

    web_custom_request("CascadeSelectService.baseFactorySelectPurveyUnit.dwr",
      "URL=http://192.168.1.60:82/biology/dwr/call/plaincall/CascadeSelectService.baseFactorySelectPurveyUnit.dwr",
      "Method=POST",
      "Resource=0",
      "RecContentType=text/javascript",
      "Referer=http://192.168.1.60:82/biology/bio/circulation/showInStoreList.action",
      "Snapshot=t9.inf",
      "Mode=HTML",
      "EncType=text/plain",
      "Body=callCount=1\npage=/biology/bio/circulation/showInStoreList.action\nhttpSessionId=26F0B68273303DA35F8D4926F5E3ED33\nscriptSessionId=8A2516F349C12996BDBEA97370E70554350\nc0-scriptName=CascadeSelectService\nc0-methodName=baseFactorySelectPurveyUnit\nc0-id=0\nc0-e1=string:1\nc0-e2=string:\nc0-e3=string:1\nc0-param0=Object_Object:{organId:reference:c0-e1, factoryId:reference:c0-e2, extraOption:reference:c0-e3}\nbatchId=2\n",
      LAST);

    //点击数据显示列表框里的【确定按钮
    //该inStoreCode的值为入库编号,需要处理的字段
    lr_start_transaction("点击事务");
    web_url("showInStoreDetail.action",
      "URL=http://192.168.1.60:82/biology/bio/circulation/showInStoreDetail.action?inStoreCode=201109RK0001",
      "Resource=0",
      "RecContentType=text/html",
      "Referer=http://192.168.1.60:82/biology/bio/circulation/showInStoreList.action",
      "Snapshot=t10.inf",
      "Mode=HTML",
      LAST);

    //点击【确认】后,页面跳至确认入库的页面
    lr_start_transaction("点击确认入库事务");

    web_submit_data("checkInstore.action",
      "Action=http://192.168.1.60:82/biology/bio/circulation/checkInstore.action",
      "Method=POST",
      "RecContentType=text/html",
      "Referer=http://192.168.1.60:82/biology/bio/circulation/showInStoreDetail.action?inStoreCode=201109RK0001",
      "Snapshot=t11.inf",
      "Mode=HTML",
      ITEMDATA,
      "Name=instoreHead.id", "Value=98", ENDITEM, //instoreHead.id为数据库中对应inStoreCode的ID,应该要同时处理。
      "Name=instoreCode", "Value=201109RK0001", ENDITEM,
      LAST);

    web_custom_request("BacterinService.searchBacterins.dwr_2",
      "URL=http://192.168.1.60:82/biology/dwr/call/plaincall/BacterinService.searchBacterins.dwr",
      "Method=POST",
      "Resource=0",
      "RecContentType=text/javascript",
      "Referer=http://192.168.1.60:82/biology/bio/circulation/showInStoreList.action",
      "Snapshot=t12.inf",
      "Mode=HTML",
      "EncType=text/plain",
      "Body=callCount=1\npage=/biology/bio/circulation/showInStoreList.action\nhttpSessionId=26F0B68273303DA35F8D4926F5E3ED33\nscriptSessionId=8A2516F349C12996BDBEA97370E70554595\nc0-scriptName=BacterinService\nc0-methodName=searchBacterins\nc0-id=0\nc0-e1=string:\nc0-param0=Object_Object:{bacterinSort:reference:c0-e1}\nbatchId=0\n",
      LAST);

    web_custom_request("CascadeSelectService.basePurveyUnitSelectFactory.dwr_2",
      "URL=http://192.168.1.60:82/biology/dwr/call/plaincall/CascadeSelectService.basePurveyUnitSelectFactory.dwr",
      "Method=POST",
      "Resource=0",
      "RecContentType=text/javascript",
      "Referer=http://192.168.1.60:82/biology/bio/circulation/showInStoreList.action",
      "Snapshot=t13.inf",
      "Mode=HTML",
      "EncType=text/plain",
      "Body=callCount=1\npage=/biology/bio/circulation/showInStoreList.action\nhttpSessionId=26F0B68273303DA35F8D4926F5E3ED33\nscriptSessionId=8A2516F349C12996BDBEA97370E70554595\nc0-scriptName=CascadeSelectService\nc0-methodName=basePurveyUnitSelectFactory\nc0-id=0\nc0-e1=string:1\nc0-e2=string:\nc0-e3=string:1\nc0-param0=Object_Object:{organId:reference:c0-e1, purveyId:reference:c0-e2, extraOption:reference:c0-e3}\nbatchId=1\n",
      LAST);

    web_custom_request("CascadeSelectService.baseFactorySelectPurveyUnit.dwr_2",
      "URL=http://192.168.1.60:82/biology/dwr/call/plaincall/CascadeSelectService.baseFactorySelectPurveyUnit.dwr",
      "Method=POST",
      "Resource=0",
      "RecContentType=text/javascript",
      "Referer=http://192.168.1.60:82/biology/bio/circulation/showInStoreList.action",
      "Snapshot=t14.inf",
      "Mode=HTML",
      "EncType=text/plain",
      "Body=callCount=1\npage=/biology/bio/circulation/showInStoreList.action\nhttpSessionId=26F0B68273303DA35F8D4926F5E3ED33\nscriptSessionId=8A2516F349C12996BDBEA97370E70554595\nc0-scriptName=CascadeSelectService\nc0-methodName=baseFactorySelectPurveyUnit\nc0-id=0\nc0-e1=string:1\nc0-e2=string:\nc0-e3=string:1\nc0-param0=Object_Object:{organId:reference:c0-e1, factoryId:reference:c0-e2, extraOption:reference:c0-e3}\nbatchId=2\n",
      LAST);

    lr_end_transaction("点击确认入库事务",LR_AUTO);

    通过关联该怎么做呢,昨天我在网上找来个资料,按照资料去做,没有成功。
    回复 支持 反对

    使用道具 举报

    该用户从未签到

    4#
    发表于 2011-9-7 11:30:47 | 只看该作者
    id和编号是你自己定吗?

    如果是自己定的,id作为一个参数进行参数化,inStoreCode作为另一个参数进行参数化
    第二次用到inStoreCode参数时,用{inStoreCode}进行取值
    回复 支持 反对

    使用道具 举报

    该用户从未签到

    5#
     楼主| 发表于 2011-9-7 14:22:31 | 只看该作者
    回复 4# 1987wing


    嗯,谢谢,成功了!
    回复 支持 反对

    使用道具 举报

    本版积分规则

    关闭

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

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

    GMT+8, 2024-11-23 10:31 , Processed in 0.075486 second(s), 27 queries .

    Powered by Discuz! X3.2

    © 2001-2024 Comsenz Inc.

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