|
录制的脚本可以正常运行。脚本的整体思路是这样。根据手工输入的工号,从数据库中取得ID,再提交结果。我试过不更改手工输入的工号,直接从数据库中取得ID进行参数化,是可以正常运行出结果的。但这样的话,和实际场景有很大差距。
我希望场景更真实些,将手工输入的工号做参数化,将ID做手动关联。但是手动关联的时候,一直没有成功。请教一下大家,为什么会失败,如何解决呢?
web_reg_save_param("id", "LB=\"Name=userids\", \"Value=", "RB=,","Search=headers", LAST);
web_submit_data("ResUserAction.do_2",
"Action=http://73.16.17.197:8008/wskp/ResUserAction.do?method=add&flag=U&function_id=26&selects=010127",
"Method=POST",
"RecContentType=text/html",
"Referer=http://73.16.17.197:8008/wskp/system/AddURO.jsp?flag=U&function_id=26&time=20138395056",
"Snapshot=t80.inf",
"Mode=HTTP",
ITEMDATA,
"Name=partuname", "Value=李英俊", ENDITEM,
"Name=userids", "Value={id}", ENDITEM, //员工ID
"Name=partupid", "Value=0101272810", ENDITEM,
"Name=partrids", "Value=168", ENDITEM, //角色
"Name=partupname", "Value=一科", ENDITEM,
"Name=flag", "Value=", ENDITEM,
"Name=id", "Value=0", ENDITEM,
"Name=function_id", "Value=", ENDITEM,
"Name=currentPage", "Value=1", ENDITEM,
"Name=pageSize", "Value=20", ENDITEM,
"Name=partrname", "Value=通用查询", ENDITEM,
"Name=roleids", "Value=168", ENDITEM, //角色
"Name=partadmin", "Value=否", ENDITEM,
"Name=partrnames", "Value=否", ENDITEM,
LAST);
// lr_output_message("id: %s",lr_eval_string("({id}"));
// lr_message("When_Txt: %s",lr_eval_string("({When_Txt}"));
lr_log_message("id :%s" ,lr_eval_string("({id}"));
Action.c(1735): Registering web_url("tj-d.gif") was successful [MsgId: MMSG-26390]
Action.c(1743): web_concurrent_end was successful, 2496 body bytes, 481 header bytes [MsgId: MMSG-26386]
Action.c(1746): Registering web_reg_save_param was successful [MsgId: MMSG-26390]
Action.c(1748): Error -26377: No match found for the requested parameter "id". Check whether the requested boundaries exist in the response data. Also, if the data you want to save exceeds 256 bytes, use web_set_max_html_param_len to increase the parameter size [MsgId: MERR-26377]
Action.c(1748): web_submit_data("ResUserAction.do_2") highest severity level was "ERROR", 72 body bytes, 186 header bytes [MsgId: MMSG-26388] |
|