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
请问是怎么回事? Any help? web_submit_form 关键的目标提交地址在哪里? 楼主是否可以提供此部分代码的上面一部分? 本帖最后由 Hercule 于 2010-12-3 16:45 编辑
skyzhu 朋友, 可以解释一下吗?
lr_start_transaction("im > Submit Violation Reason"); 和 lr_end_transaction("im > Submit Violation Reason",LR_AUTO);
是我录制之前、之后的操作。 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);
少有URL吧 换成web_submit_data发送请求,就可以将那些URL删除掉了。 多谢skyzhu 和C组十三朋友。 多谢skyzhu 和 c组13 朋友。 msnshow 朋友,您老师啥意思? 使用web_submit_data还是有问题。
Error is like
Walue of tag<selectitems> attribute is incorrect. 只能提供一个大体的思路,楼上已经说了2个方面。
1、补充完整URL
2、使用web_submit_data方式发送请求
考虑到有时候请求的特殊性,之前我还用过JAVA编码发送请求,也就是当使用LR提供的函数不能解决问题时,可以考虑直接编码通讯部分,组包发送请求。
Walue的标记< selectitems >属性是不正确的,就是你发送的请求中,部分内容的属性错了,可能是位置,可能是长度,可能是类型,可能是值不对等等。 回复 7# msnshow
就是你把提交的URL给弄丢了造成的
页:
[1]