Hercule 发表于 2010-12-1 18:00:24

Help for web_submit_form

本帖最后由 Hercule 于 2010-12-1 18:10 编辑

大家好!

我进行了录制, script --
lr_start_transaction("im > Submit Violation Reason");

web_submit_form("update_im_ticket.xhtml_7",
ITEMDATA,
"Name=update_ticket_form_id:ntfViolationReason", "Value=Violation", ENDITEM,
"Name=update_ticket_form_id:rmdSelector", "Value=Please Select", ENDITEM,
"Name=update_ticket_form_id:rmdTypeSelector", "Value=Please Select", ENDITEM,
"Name=update_ticket_form_id:rmdActionSelector", "Value=Please Select", ENDITEM,
"Name=update_ticket_form_id:rmdEnterText", "Value=", ENDITEM,
"Name=cancelCodeForm:cancelCodeDecorator:cancelCodeId", "Value=<OFF>", ENDITEM,
"NamePfx=cancelCodeForm:cancelTextDecorator:j_id", "Value=", ENDITEM,
"NamePfx=onholdCodeForm:aonholdCodeDecorator:j_id", "Value=<OFF>", ENDITEM,
"NamePfx=resoCodeForm:resoCodeDecorator:j_id", "Value=<OFF>", ENDITEM,
"NamePfx=resoCodeForm:resoTextDecorator:j_id", "Value=", ENDITEM,
//"NamePfx=j_id", "Value=", "File=Yes", ENDITEM,
"Name=selectCiPanelbrowserForm:selectCiPanelresults", "Value=<OFF>", ENDITEM,
"Name=selectCiPanelbrowserForm:selectCiPanelselected", "Value=<OFF>", ENDITEM,
"Name=update_ticket_form_id:slaViolationButton", "Value=Submit Violation Reason", ENDITEM,
EXTRARES,
"Url=../favicon.ico", "Referer=", ENDITEM,
LAST);

lr_end_transaction("im > Submit Violation Reason",LR_AUTO);

回放的时候出错--
im_update_ticket.c(608): Error -27979: Requested form not found, Snapshot Info          
im_update_ticket.c(608): web_submit_form("update_im_ticket.xhtml_7") highest severity level was "ERROR", 0 body bytes, 0 header bytes         

请问是怎么回事?

Hercule 发表于 2010-12-2 09:10:59

Any help?

skyzhu 发表于 2010-12-2 10:30:31

web_submit_form 关键的目标提交地址在哪里?

泥泥虫 发表于 2010-12-2 10:35:01

楼主是否可以提供此部分代码的上面一部分?

Hercule 发表于 2010-12-3 16:44:11

本帖最后由 Hercule 于 2010-12-3 16:45 编辑

skyzhu 朋友, 可以解释一下吗?

lr_start_transaction("im > Submit Violation Reason"); 和 lr_end_transaction("im > Submit Violation Reason",LR_AUTO);

是我录制之前、之后的操作。

skyzhu 发表于 2010-12-3 21:41:11

web_submit_form 这个函数是和缓存有关系的,所以要看你前面访问的是什么页面,删除前面相关脚本就会找不到目标地址
建议使用web_submit_data 比较独立,参数差不多,帮助一看就能明白
web_submit_data("update_im_ticket.xhtml_7",
"Action=XXXXX这里是FORM提交的目标地址",
"Method=POST",
"RecContentType=text/html",
"Mode=HTTP",
ITEMDATA,
"Name=update_ticket_form_id:ntfViolationReason", "Value=Violation", ENDITEM,
"Name=update_ticket_form_id:rmdSelector", "Value=Please Select", ENDITEM,
"Name=update_ticket_form_id:rmdTypeSelector", "Value=Please Select", ENDITEM,
"Name=update_ticket_form_id:rmdActionSelector", "Value=Please Select", ENDITEM,
"Name=update_ticket_form_id:rmdEnterText", "Value=", ENDITEM,
"Name=cancelCodeForm:cancelCodeDecorator:cancelCodeId", "Value=<OFF>", ENDITEM,
"NamePfx=cancelCodeForm:cancelTextDecorator:j_id", "Value=", ENDITEM,
"NamePfx=onholdCodeForm:aonholdCodeDecorator:j_id", "Value=<OFF>", ENDITEM,
"NamePfx=resoCodeForm:resoCodeDecorator:j_id", "Value=<OFF>", ENDITEM,
"NamePfx=resoCodeForm:resoTextDecorator:j_id", "Value=", ENDITEM,
//"NamePfx=j_id", "Value=", "File=Yes", ENDITEM,
"Name=selectCiPanelbrowserForm:selectCiPanelresults", "Value=<OFF>", ENDITEM,
"Name=selectCiPanelbrowserForm:selectCiPanelselected", "Value=<OFF>", ENDITEM,
"Name=update_ticket_form_id:slaViolationButton", "Value=Submit Violation Reason", ENDITEM,
LAST);

msnshow 发表于 2010-12-4 14:19:39

少有URL吧

C组十三 发表于 2010-12-6 23:58:08

换成web_submit_data发送请求,就可以将那些URL删除掉了。

Hercule 发表于 2010-12-7 15:49:39

多谢skyzhu 和C组十三朋友。

Hercule 发表于 2010-12-7 15:50:40

多谢skyzhu 和 c组13 朋友。

Hercule 发表于 2010-12-7 16:02:19

msnshow 朋友,您老师啥意思?

Hercule 发表于 2010-12-7 17:04:06

使用web_submit_data还是有问题。

Error is like
Walue of tag<selectitems> attribute is incorrect.

C组十三 发表于 2010-12-7 20:32:32

只能提供一个大体的思路,楼上已经说了2个方面。
1、补充完整URL
2、使用web_submit_data方式发送请求
考虑到有时候请求的特殊性,之前我还用过JAVA编码发送请求,也就是当使用LR提供的函数不能解决问题时,可以考虑直接编码通讯部分,组包发送请求。

Walue的标记< selectitems >属性是不正确的,就是你发送的请求中,部分内容的属性错了,可能是位置,可能是长度,可能是类型,可能是值不对等等。

msnshow 发表于 2010-12-9 13:56:34

回复 7# msnshow


    就是你把提交的URL给弄丢了造成的
页: [1]
查看完整版本: Help for web_submit_form