|
登录提交信息中有两处关联,应怎么手动关联第二处?
请问各位高手,本人测试某网站的登录功能,但登录页面中必须输入已注册用户名、密码和校验码(登录页面每刷新一次,客户端就向服务器请求,服务器返回一个随机码);填写完三个信息后一并提交数据,经服务器验证无误后放转入相应页面。本人录制的脚本如下:
#include "as_web.h"
Action()
{
web_set_max_html_param_len("1024");
/* Registering parameter(s) from source task id 2
// {JSESSIONID3} = "2021D41BFE52483418154E36FD876A2E"
// */
web_reg_save_param("JSESSIONID3",
"LB/IC=jsessionid=",
"RB/IC=\"",
"Ord=1",
"Search=body",
"RelFrameId=1",
LAST);
// [WCSPARAM WCSParam_Diff1 32 2021D41BFE52483418154E36FD876A2E] Parameter {WCSParam_Diff1} created by Correlation Studio
web_reg_save_param( "WCSParam_Diff1", "LB=Set-Cookie: JSESSIONID=", "RB=;", "Ord=1", "Search=Headers", "RelFrameId=1", LAST );
web_reg_save_param("WCSParam_Diff2","LB=Value=","RB=\"","Ord=1","Search=body","RelFrameID=1",LAST);
web_url("login.jsp",
"URL=http://192.168.9.109/personnel/portal/login/login.jsp",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t1.inf",
"Mode=HTML",
EXTRARES,
"Url=../images/bg.gif", ENDITEM,
"Url=../images/top.gif", ENDITEM,
"Url=../images/top.swf", "Referer=", ENDITEM,
"Url=../images/ziye_left.gif", ENDITEM,
"Url=../images/text_top.gif", ENDITEM,
"Url=../images/text_title_wssb.gif", ENDITEM,
"Url=../images/button.gif", ENDITEM,
LAST);
lr_think_time( 17 );
web_submit_form("login.do;jsessionid={WCSParam_Diff1}",
"Snapshot=t2.inf",
ITEMDATA,
"Name=username", "Value=testing", ENDITEM,
"Name=pwd", "Value=12345", ENDITEM,
"Name=checknum", "Value={WCSParam_Diff2}", ENDITEM,
"Name=submit", "Value=µÇ ¼", ENDITEM,
EXTRARES,
"Url=portal/images/bg.gif", ENDITEM,
"Url=portal/images/top.gif", ENDITEM,
"Url=portal/images/top.swf", "Referer=", ENDITEM,
"Url=portal/images/ziye_left.gif", ENDITEM,
"Url=portal/images/text_title_wssb.gif", ENDITEM,
"Url=portal/images/text_top.gif", ENDITEM,
LAST);
lr_think_time( 6 );
web_link("Í˳öµÇ¼",
"Text=Í˳öµÇ¼",
"Snapshot=t3.inf",
LAST);
web_url("login.jsp_2",
"URL=http://192.168.9.109/personnel/portal/login/login.jsp",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t4.inf",
"Mode=HTML",
EXTRARES,
"Url=../images/top.gif", ENDITEM,
"Url=../images/bg.gif", ENDITEM,
"Url=../images/top.swf", "Referer=", ENDITEM,
"Url=../images/ziye_left.gif", ENDITEM,
"Url=../images/text_top.gif", ENDITEM,
"Url=../images/text_title_wssb.gif", ENDITEM,
"Url=../images/button.gif", ENDITEM,
LAST);
return 0;
}
第一处关联WCSParam_Diff1是lr自动关联的,第二处关联WCSParam_Diff2是本人手动加上去的,但无论怎么修改,运行时总报如下错误:
Action.c(28): Found resource "http://192.168.9.109/personnel/portal/images/bottom_bg.gif" in HTML "http://192.168.9.109/personnel/portal/login/login.jsp" [MsgId: MMSG-26659]
Action.c(28): Error -27190: No match found for the requested parameter "WCSParam_Diff2". Check whether the requested boundaries exist in the response data. Also, if the data you want to save exceeds 1024 bytes, use web_set_max_html_param_len to increase the parameter size [MsgId: MERR-27190]
Action.c(28): web_url highest severity level was "ERROR", 231859 body bytes, 2624 header bytes, 33 chunking overhead bytes [MsgId: MMSG-27177]
Ending action Action.
Ending iteration 1.
……
不知道如何解决这种加密验证的录制问题,请各位高手指点小妹,刚学lr没多久,正在学习中。谢谢!期待着您们的答复。 |
|