51Testing软件测试论坛
标题:
有高手不?我想录制有验证码的页面,可是老报错
[打印本页]
作者:
xuxu2011
时间:
2012-2-24 17:46
标题:
有高手不?我想录制有验证码的页面,可是老报错
我先是录制一下注册页面,然后先将session关联,后来又进行参数化。只是有验证码,我查的网上,在脚本里加了一段代码,可是回放老是报错:Action.c(62) The "EXTRARES" argument(number 22)is not allowed within a concurrent group!请高手帮忙看看!
以下是我的脚本代码:
Action()
{
web_set_max_html_param_len("1024");
web_url("GMSC",
"URL=http://1.1.1.67:8080/GMSC",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t1.inf",
"Mode=HTML",
EXTRARES,
"Url=/GMSC/login_common/images/banner.jpg", "Referer=http://1.1.1.67:8080/GMSC/", ENDITEM,
"Url=/GMSC/login_common/images/l-6.jpg", "Referer=http://1.1.1.67:8080/GMSC/", ENDITEM,
"Url=/GMSC/login_common/images/r-11.gif", "Referer=http://1.1.1.67:8080/GMSC/", ENDITEM,
"Url=/GMSC/login_common/images/r-1.jpg", "Referer=http://1.1.1.67:8080/GMSC/", ENDITEM,
"Url=/GMSC/login_common/images/r-g.jpg", "Referer=http://1.1.1.67:8080/GMSC/", ENDITEM,
"Url=/GMSC/login_common/images/r-6.jpg", "Referer=http://1.1.1.67:8080/GMSC/", ENDITEM,
"Url=/GMSC/login_common/images/top.gif", "Referer=http://1.1.1.67:8080/GMSC/login_common/public/top.html", ENDITEM,
LAST);
web_url("r-3.jpg",
"URL=http://1.1.1.67:8080/GMSC/member/regindex.jsp",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Referer=http://1.1.1.67:8080/GMSC/",
"Snapshot=t2.inf",
"Mode=HTML",
EXTRARES,
"Url=../login_common/images/pub01.jpg", ENDITEM,
"Url=../login_common/images/pic05.jpg", ENDITEM,
LAST);
//取得的验证码页面mycode.jsp
web_url("mycord.jsp",
"URL=http://1.1.1.67:8080/GMSC/member/mycord2.jsp",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t2.inf",
"Mode=HTTP",
LAST);
web_concurrent_start(NULL);
//原来的验证码页面code.jsp
web_url("code.jsp",
"URL=http://1.1.1.67:8080/GMSC/login_common/common/code.jsp",
"Resource=0",
"RecContentType=image/jpeg",
"Referer=http://1.1.1.67:8080/GMSC/member/mycord2.jsp",
LAST);
//获取mycode2.jsp页面中的验证码
web_reg_save_param("myvalidate","LB/IC=X","RB/IC=X","Ord=1", "Search=body",LAST);
web_url("myvalidate",
"URL=http://1.1.1.67:8080/GMSC/member/mycord.jsp","RecContentType=text/html",
"Referer=http://1.1.1.67:8080/GMSC/member/mycord2.jsp",
"Snapshot=t5.inf",
"Mode=HTTP",
LAST);
// [WCSPARAM WCSParam_Diff1 32 6M7EVG14X3LQPZWV1VCX2W14UXDUCQA4] Parameter {WCSParam_Diff1} created by Correlation Studio
web_reg_save_param( "WCSParam_Diff1", "LB= value=\"", "RB=\"", "Ord=2", "IgnoreRedirections=Yes", "Search=Body", "RelFrameId=1", LAST );
web_submit_data("xkpersonreg.action",
"Action=http://1.1.1.67:8080/GMSC/member/xkpersonreg.action",
"Method=POST",
"TargetFrame=",
"RecContentType=text/html",
"Referer=http://1.1.1.67:8080/GMSC/member/regindex.jsp",
"Snapshot=t3.inf",
"Mode=HTML",
ITEMDATA,
"Name=pkcs", "Value=", ENDITEM,
"Name=cert", "Value=", ENDITEM,
"Name=loginTokenSign", "Value=", ENDITEM,
"Name=loginClientCert", "Value=", ENDITEM,
EXTRARES,
"Url=../login_common/templates/default/lhgcore/lhgcheck/images/wait.gif", ENDITEM,
"Url=checkEamil.action?Rnd=0.14497954909588817&loginEmail={loginMail}", ENDITEM,
"Url=../login_common/templates/default/lhgcore/lhgcheck/images/info.gif", ENDITEM,
"Url=checkValidate.action?Rnd=0.7209663625010396&validate={myvalidate}", ENDITEM,
LAST);
web_submit_data("checkDocumentNO.action",
"Action=http://1.1.1.67:8080/GMSC/member/checkDocumentNO.action",
"Method=POST",
"TargetFrame=",
"Referer=http://1.1.1.67:8080/GMSC/member/xkpersonreg.action",
"Snapshot=t4.inf",
"Mode=HTML",
ITEMDATA,
"Name=documentType", "Value=01", ENDITEM,
"Name=documentNO", "Value={documentno}", ENDITEM,
LAST);
web_submit_data("checkxkpersonreg.action",
"Action=http://1.1.1.67:8080/GMSC/member/checkxkpersonreg.action",
"Method=POST",
"TargetFrame=",
"RecContentType=text/html",
"Referer=http://1.1.1.67:8080/GMSC/member/xkpersonreg.action",
"Snapshot=t6.inf",
"Mode=HTTP",
ITEMDATA,
"Name=struts.token.name", "Value=struts.token", ENDITEM,
"Name=struts.token", "Value={WCSParam_Diff1}", ENDITEM,
"Name=loginEmail", "Value={loginMail}", ENDITEM,
"Name=password", "Value={password}", ENDITEM,
"Name=passwordconfirm", "Value={password}", ENDITEM,
"Name=applyName", "Value={applyName}", ENDITEM,
"Name=documentType", "Value=01", ENDITEM,
"Name=documentNO", "Value={documentno}", ENDITEM,
"Name=phone", "Value={mobile}", ENDITEM,
"Name=validate", "Value={myvalidate}", ENDITEM,
LAST);
lr_log_message("-------:%s", lr_eval_string("{myvalidate}"));
return 0;
}
作者:
xuxu2011
时间:
2012-2-25 12:28
怎么都没人回答?
作者:
xuxu2011
时间:
2012-2-25 12:28
怎么都没人回答?
作者:
T_LONE
时间:
2012-2-25 17:26
哈哈 新手看不懂 帮你顶顶
作者:
linglvchao
时间:
2012-5-22 17:01
有验证码的脚本是需要用到关联的,也就是它每次login请求登录的时候会自动生成一个验证码。你可以采用关联让它每次返回的数据都是前一次请求的。
作者:
wanghaibin
时间:
2012-7-26 22:43
两个极端的解决方式(适用于自己公司开发的产品):
第一:录制脚本前,把验证码的功能关掉;
第二:把验证码设置成一个,始终都是一个,就可以了。
如果像qq注册那种的页面,我也没办法。
作者:
wanghuiwan
时间:
2012-8-1 11:09
看到上面的验证码是存在与返回信息的?
正常情况下验证码都是由图片显示的 不知道你怎么能获取到图片上的
除非使用那种图片扫描工具进行匹配 但是准确性也不是那么高
欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/)
Powered by Discuz! X3.2