Kadar 发表于 2011-8-31 09:33:19

录制脚本怎么抓住列表中的【确认】按钮

本帖最后由 Kadar 于 2011-8-31 09:46 编辑

我使用LR8.1录制新增入库单,在新的入库记录添加好以后,有个确认入库的操作,界面如图1。先在列表中选择要入库数据的确认按钮,然后页面跳至下页
点击图2中的确认入库按钮,这条数据才会添加到库存当中。
我录制脚本,回放后,没有报错,但是数据没有添加到库存中,仅仅是新增了一条入库记录。
脚本中也有录制到后续操作,但是就是回放后,没有执行到把入库记录添加到库存中去,下面是从需要点击入库记录的【确认】按钮后的脚本,哪位能指导指导我啊!谢谢啦!
lr_start_transaction("点击确认");
web_url("showInStoreDetail.action",
"URL=http://192.168.1.60:82/biology/bio/circulation/showInStoreDetail.action?inStoreCode=201108RK0050",
"Resource=0",
"RecContentType=text/html",
"Referer=http://192.168.1.60:82/biology/bio/circulation/showInStoreList.action?printCode=201108RK0050",
"Snapshot=t156.inf",
"Mode=HTTP",
LAST);
web_concurrent_start(NULL);
web_url("DWRAction.js_6",
"URL=http://192.168.1.60:82/biology/dwr/interface/DWRAction.js",
"Resource=1",
"RecContentType=text/plain",
"Referer=http://192.168.1.60:82/biology/bio/circulation/showInStoreDetail.action?inStoreCode=201108RK0050",
"Snapshot=t157.inf",
LAST);
web_url("engine.js_6",
"URL=http://192.168.1.60:82/biology/dwr/engine.js",
"Resource=1",
"RecContentType=text/javascript",
"Referer=http://192.168.1.60:82/biology/bio/circulation/showInStoreDetail.action?inStoreCode=201108RK0050",
"Snapshot=t158.inf",
LAST);
web_url("BacterinService.js_6",
"URL=http://192.168.1.60:82/biology/dwr/interface/BacterinService.js",
"Resource=1",
"RecContentType=text/plain",
"Referer=http://192.168.1.60:82/biology/bio/circulation/showInStoreDetail.action?inStoreCode=201108RK0050",
"Snapshot=t159.inf",
LAST);
web_url("CascadeSelectService.js_6",
"URL=http://192.168.1.60:82/biology/dwr/interface/CascadeSelectService.js",
"Resource=1",
"RecContentType=text/plain",
"Referer=http://192.168.1.60:82/biology/bio/circulation/showInStoreDetail.action?inStoreCode=201108RK0050",
"Snapshot=t160.inf",
LAST);
web_concurrent_end(NULL);
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=201108RK0050",
"Snapshot=t161.inf",
"Mode=HTTP",
ITEMDATA,
"Name=instoreHead.id", "Value=59", ENDITEM,
"Name=instoreCode", "Value=201108RK0050", ENDITEM,
LAST);
web_concurrent_start(NULL);
web_url("DWRAction.js_7",
"URL=http://192.168.1.60:82/biology/dwr/interface/DWRAction.js",
"Resource=1",
"RecContentType=text/plain",
"Referer=http://192.168.1.60:82/biology/bio/circulation/showInStoreList.action",
"Snapshot=t162.inf",
LAST);
web_url("engine.js_7",
"URL=http://192.168.1.60:82/biology/dwr/engine.js",
"Resource=1",
"RecContentType=text/javascript",
"Referer=http://192.168.1.60:82/biology/bio/circulation/showInStoreList.action",
"Snapshot=t163.inf",
LAST);
web_url("BacterinService.js_7",
"URL=http://192.168.1.60:82/biology/dwr/interface/BacterinService.js",
"Resource=1",
"RecContentType=text/plain",
"Referer=http://192.168.1.60:82/biology/bio/circulation/showInStoreList.action",
"Snapshot=t164.inf",
LAST);
web_url("CascadeSelectService.js_7",
"URL=http://192.168.1.60:82/biology/dwr/interface/CascadeSelectService.js",
"Resource=1",
"RecContentType=text/plain",
"Referer=http://192.168.1.60:82/biology/bio/circulation/showInStoreList.action",
"Snapshot=t165.inf",
LAST);
web_concurrent_end(NULL);
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=t166.inf",
"Mode=HTTP",
"EncType=text/plain",
"Body=callCount=1\npage=/biology/bio/circulation/showInStoreList.action\nhttpSessionId=5E746B32A91DB710DE085BDE8B0A1A5A\nscriptSessionId=D75CAE25AD0A71E36452386C29274315593\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=t167.inf",
"Mode=HTTP",
"EncType=text/plain",
"Body=callCount=1\npage=/biology/bio/circulation/showInStoreList.action\nhttpSessionId=5E746B32A91DB710DE085BDE8B0A1A5A\nscriptSessionId=D75CAE25AD0A71E36452386C29274315593\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=t168.inf",
"Mode=HTTP",
"EncType=text/plain",
"Body=callCount=1\npage=/biology/bio/circulation/showInStoreList.action\nhttpSessionId=5E746B32A91DB710DE085BDE8B0A1A5A\nscriptSessionId=D75CAE25AD0A71E36452386C29274315593\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);
lr_end_transaction("点击确认",LR_AUTO);

mymagic 发表于 2011-8-31 09:58:47

你再录制一个脚本
注意看一下
nscriptSessionId=D75CAE25AD0A71E36452386C29274315593

Kadar 发表于 2011-8-31 10:11:54

本帖最后由 Kadar 于 2011-8-31 10:15 编辑

回复 2# mymagic

再次录制,这个值不一样了,现在是nscriptSessionId=F2C2769C992AA53B594CFA703FC681C9864
下面该怎么弄呢?谢谢。这个【确认】是一个超链接,我用的是URL的录制方式,用HTML录制的时候
有一个web_link的函数在回放的时候报错
web_link("?",
    "Text=?",
   "Ordinal=1",
   "Snapshot=t6.inf",
LAST);

mymagic 发表于 2011-8-31 11:13:03

手动关联nscriptSessionId

mymagic 发表于 2011-8-31 11:14:03

nhttpSessionId=5E746B32A91DB710DE085BDE8B0A1A5A
这个呢?
感觉好多sessionid呢?

Kadar 发表于 2011-8-31 13:42:24

本帖最后由 Kadar 于 2011-8-31 13:45 编辑

nhttpSessionId和nscriptSessionId是产生在客户端请求时,这个也需要做关联吗,不需要吧.(附件是截的Generation Log中的日志)

mymagic 发表于 2011-8-31 13:54:36

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=201108RK0050",
"Snapshot=t161.inf",
"Mode=HTTP",
ITEMDATA,
"Name=instoreHead.id", "Value=59", ENDITEM,
"Name=instoreCode", "Value=201108RK0050", ENDITEM,
LAST);


Value=201108RK0050   这个?

Kadar 发表于 2011-8-31 14:08:42

本帖最后由 Kadar 于 2011-8-31 14:10 编辑

回复 7# mymagic


这个是入库记录的编号,在第一个帖子中的图1可以看到的--“入库编号”;
现在就是回放脚本结束后,再到系统里查询入库记录时,新增的那条数据仍然在操作列中显示:【修改】、【删除】、【确认】三个操作,按照我的想法是,操作列中只有一个【删除】操作,因为如果成功运行的话,我的新增入库记录已经添加进库存了,页面只会显示【删除】的。
第一个帖子中的脚本就是我从点击【确定】这个超链接开始一直到录制结束。但是最后运行的时候并没有能够成功入库,所以我想会不会是我脚本中没有抓到【确定】这个超链接。:Q

Kadar 发表于 2011-8-31 14:29:01

回复 7# mymagic

谢谢你的提醒!我知道了,脚本中的入库编号要参数化,还有一个instoreHead.id跟入库编号有关系,这个可能就是问题所在,我去尝试一下。:handshake

mymagic 发表于 2011-8-31 15:06:42

回复 9# Kadar


    :)

polly12052000 发表于 2011-9-30 15:09:36

结果呢,搞定了吗

polly12052000 发表于 2011-9-30 15:11:17

结果呢,搞定了吗。:loveliness:

polly12052000 发表于 2011-9-30 16:09:22

结果呢,搞定了吗。:loveliness:
页: [1]
查看完整版本: 录制脚本怎么抓住列表中的【确认】按钮