51Testing软件测试论坛
标题:
LR关联怎么确定需关联的数据
[打印本页]
作者:
905922870
时间:
2013-10-29 09:27
标题:
LR关联怎么确定需关联的数据
本帖最后由 905922870 于 2013-10-29 14:48 编辑
关联函数会用了,也知道关联是怎么回事,但是在实际应用中就是找不到需要关联的函数,例:一个新建商品信息后提交审批的流程,脚本回放可以新建但是不会提交,脚本中做了关联编译无错误回放提示成功,但是数据还是没有提交成功,以下是脚本
Action()
{
lr_start_transaction("新建");
lr_think_time(0);
web_url("scSpxxEditActions!onLoadXssp.action",
"URL=http://192.168.10.12:9999/scgl/spgl/scSpxxEditActions!onLoadXssp.action?qdBj=1&flag=1&id=0&__d__=1",
"Resource=0",
"RecContentType=text/html",
"Referer=http://192.168.10.12:9999/home.shtml",
"Snapshot=t8.inf",
"Mode=HTML",
EXTRARES,
"Url=/js/framework/yz/skin/default/css/__Yz.combotree.css", "Referer=http://192.168.10.12:9999/scgl/spgl/scSpxxEditActions!onLoadXssp.action?qdBj=1&flag=1&id=0&__d__=1", ENDITEM,
"Url=/js/framework/yz/skin/default/css/__Yz.combobox.ex.css", "Referer=http://192.168.10.12:9999/scgl/spgl/scSpxxEditActions!onLoadXssp.action?qdBj=1&flag=1&id=0&__d__=1", ENDITEM,
"Url=/js/framework/yz/skin/default/css/__Yz.radiobutton.css", "Referer=http://192.168.10.12:9999/scgl/spgl/scSpxxEditActions!onLoadXssp.action?qdBj=1&flag=1&id=0&__d__=1", ENDITEM,
"Url=/sys/dict/cacheDictFetchActions!fetchDictItems.action?dictName=dm_sc_pp&filters=%5B%5D", "Referer=http://192.168.10.12:9999/scgl/spgl/scSpxxEditActions!onLoadXssp.action?qdBj=1&flag=1&id=0&__d__=1", ENDITEM,
"Url=/js/framework/yz/skin/default/images/Yz.combobox.button.gif", "Referer=http://192.168.10.12:9999/scgl/spgl/scSpxxEditActions!onLoadXssp.action?qdBj=1&flag=1&id=0&__d__=1", ENDITEM,
"Url=scSpxxEditActions!getShqyDms.action", "Referer=http://192.168.10.12:9999/scgl/spgl/scSpxxEditActions!onLoadXssp.action?qdBj=1&flag=1&id=0&__d__=1", ENDITEM,
"Url=/sys/dict/cacheDictFetchActions!fetchDictItems.action?dictName=dm_sc_dw&filters=%5B%5D", "Referer=http://192.168.10.12:9999/scgl/spgl/scSpxxEditActions!onLoadXssp.action?qdBj=1&flag=1&id=0&__d__=1", ENDITEM,
"Url=/js/framework/yz/skin/default/images/Yz.radiobutton.gif", "Referer=http://192.168.10.12:9999/scgl/spgl/scSpxxEditActions!onLoadXssp.action?qdBj=1&flag=1&id=0&__d__=1", ENDITEM,
"Url=/sys/dict/cacheDictFetchActions!fetchDictItems.action?dictName=dm_sc_chfs&filters=%5B%5D", "Referer=http://192.168.10.12:9999/scgl/spgl/scSpxxEditActions!onLoadXssp.action?qdBj=1&flag=1&id=0&__d__=1", ENDITEM,
"Url=spxx/scSpxxActions!fetchProviders.action", "Referer=http://192.168.10.12:9999/scgl/spgl/scSpxxEditActions!onLoadXssp.action?qdBj=1&flag=1&id=0&__d__=1", ENDITEM,
"Url=/js/framework/yz/skin/default/images/Yz.combobox.checkbox.gif", "Referer=http://192.168.10.12:9999/scgl/spgl/scSpxxEditActions!onLoadXssp.action?qdBj=1&flag=1&id=0&__d__=1", ENDITEM,
LAST);
web_url("Yz.combotree.html",
"URL=http://192.168.10.12:9999/js/framework/yz/Yz.combotree.html",
"Resource=0",
"RecContentType=text/html",
"Referer=http://192.168.10.12:9999/home.shtml",
"Snapshot=t9.inf",
"Mode=HTML",
EXTRARES,
"Url=/spgl/splb/splbActions!clientInterface.action?nodeId=2&bizItemCode=&m=1&_=
1382954198182
", ENDITEM,
"Url=/spgl/splb/splbActions!clientInterface.action?nodeId=2&bizItemCode=&m=6&_=
1382954198510
", ENDITEM,
LAST);
lr_think_time(0);
web_submit_data("scSpxxEditActions!save.action",
"Action=http://192.168.10.12:9999/scgl/spgl/scSpxxEditActions!save.action",
"Method=POST",
"Referer=http://192.168.10.12:9999/scgl/spgl/scSpxxEditActions!onLoadXssp.action?qdBj=1&flag=1&id=0&__d__=1",
"Mode=HTML",
ITEMDATA,
"Name=data.cplbDm", "Value=SA", ENDITEM,
"Name=data.ppDm", "Value=96", ENDITEM,
"Name=data.cpDm", "Value=
N12345678904
", ENDITEM,
"Name=data.cpMc", "Value=test", ENDITEM,
"Name=data.qyDm", "Value=440403", ENDITEM,
"Name=data.dwDm", "Value=01", ENDITEM,
"Name=data.dj", "Value=", ENDITEM,
"Name=data.cgDj", "Value=", ENDITEM,
"Name=data.cgZq", "Value=0", ENDITEM,
"Name=data.jf", "Value=", ENDITEM,
"Name=data.ghfs", "Value=0", ENDITEM,
"Name=data.chfsDm", "Value=3", ENDITEM,
"Name=data.gysId", "Value=", ENDITEM,
"Name=data.gysQyjc", "Value=", ENDITEM,
"Name=data.synx", "Value=", ENDITEM,
"Name=data.sdBj", "Value=1", ENDITEM,
"Name=data.dhxs", "Value=0", ENDITEM,
"Name=data.glcpmc", "Value=", ENDITEM,
"Name=data.glcpdm", "Value=", ENDITEM,
"Name=data.cpMs", "Value=", ENDITEM,
"Name=data.snBj", "Value=0", ENDITEM,
"Name=data.jybz", "Value=1", ENDITEM,
"Name=data.jyff", "Value=1", ENDITEM,
"Name=data.xgYy", "Value=", ENDITEM,
"Name=data.id", "Value=0", ENDITEM,
"Name=data.cplx", "Value=2", ENDITEM,
"Name=data.xzBj", "Value=1", ENDITEM,
"Name=data.tsspBj", "Value=0", ENDITEM,
"Name=data.isHy", "Value=", ENDITEM,
"Name=data.qdBj", "Value=51003", ENDITEM,
LAST);
web_submit_data("qdSpxxglAction!fetchQdspxxList.action_2",
"Action=http://192.168.10.12:9999/qdManage/qdywgl/qdSpxxglAction!fetchQdspxxList.action?cplx=2&xzBj=1",
"Method=POST",
"RecContentType=text/plain",
"Referer=http://192.168.10.12:9999/qdgl/qdywgl/qdspgl/xsspgl/qdxsspAddList.shtml",
"Snapshot=t10.inf",
"Mode=HTML",
ITEMDATA,
"Name=page", "Value=1", ENDITEM,
"Name=rows", "Value=50", ENDITEM,
EXTRARES,
"Url=/afl/processActions!fetchMyTodoCount.action", "Referer=http://192.168.10.12:9999/home.shtml", ENDITEM,
"Url=/js/framework/yz/skin/default/images/Yz.dialog/q.gif", "Referer=http://192.168.10.12:9999/home.shtml", ENDITEM,
LAST);
lr_end_transaction("新建",LR_AUTO);
lr_start_transaction("提交审核");
web_custom_request("scSpxxActions!submitItems.action",
"URL=http://192.168.10.12:9999/scgl/spgl/spxx/scSpxxActions!submitItems.action?id=
65308
",
"Method=POST",
"Resource=1",
"Referer=http://192.168.10.12:9999/qdgl/qdywgl/qdspgl/xsspgl/qdxsspAddList.shtml#",
"EncType=",
LAST);
web_submit_data("qdSpxxglAction!fetchQdspxxList.action_3",
"Action=http://192.168.10.12:9999/qdManage/qdywgl/qdSpxxglAction!fetchQdspxxList.action?cplx=2&xzBj=1",
"Method=POST",
"RecContentType=text/plain",
"Referer=http://192.168.10.12:9999/qdgl/qdywgl/qdspgl/xsspgl/qdxsspAddList.shtml#",
"Snapshot=t11.inf",
"Mode=HTML",
ITEMDATA,
"Name=page", "Value=1", ENDITEM,
"Name=rows", "Value=50", ENDITEM,
LAST);
lr_end_transaction("提交审核",LR_AUTO);
return 0;
}
作者:
905922870
时间:
2013-10-29 09:31
我标红的几个地方是差异的地方
作者:
398073412
时间:
2013-10-29 13:23
像你这种帖子都不会发,有好多人都这样
我就一直纳闷··你们的理解能力真的那么差吗?买跟卖都分不清,不适合干测试啊
作者:
905922870
时间:
2013-10-29 13:50
回复
3#
398073412
额 才研究LR 高手 问题在哪儿求赐教
作者:
905922870
时间:
2013-10-29 13:52
回复
3#
398073412
额 才研究LR 高手 问题在哪儿求赐教
web_reg_save_param("ID",
"LB=\"欧阳\",\"id\":",
"RB=,\"tsspbj\":\"0\"",
"NotFound=ERROR",
"Search=All",
LAST);
作者:
tianlang001
时间:
2013-10-29 14:03
3楼说的是给你解决问题还要付你分,你求助别人还要别人付费
作者:
905922870
时间:
2013-10-29 14:47
回复
6#
tianlang001
恩恩 知道了 我第一次来51求助没注意 以为那是给分呢
作者:
398073412
时间:
2013-10-31 09:43
新建成功后会返回该单据的唯一标识(一般是id),而提交审核一般也是根据该标识,实际上标识是哪个就要你自己确认或问开发人员了
你的关联函数应该是放在新建保存的那个页面之前,不知道你放在哪个位置了?
你可以查找这两个页面的http视图中的返回信息(直接搜索id值65308),看看到底是那个页面返回id(要关联的值),然后把函数放在它之前
web_submit_data("scSpxxEditActions!save.action",
web_submit_data("qdSpxxglAction!fetchQdspxxList.action_2",
如果以上还不行的话,有可能需要关联的不是这个id吧
还有检查你左右边界是否正确
作者:
lin39320028
时间:
2013-10-31 09:48
刚看到一个文章
http://bbs.51testing.com/thread-993651-1-2.html
关联其实就是调试脚本,里面讲得还可以。不同系统关联的地方都不一样,测试人员最主要是确认脚本是正确的,就是调试脚本到正确。
作者:
905922870
时间:
2013-10-31 18:19
回复
8#
398073412
[attach]87781[/attach]这是脚本 是放在它之前了
欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/)
Powered by Discuz! X3.2