web测试,LR录制成功后,发现无法录制服务器返回数据
:Q 录制B/S结构的系统。选择协议:http
录制过程很顺利,但是录制后发现在登录过程中脚本中,只有发送数据,没有服务器返回数据。
脚本回放,观察浏览页面,没有数据显现,page页只是一个框架。
登录action如下:通过用户判断权限与角色。
Action()
{
web_submit_data("Login.aspx",
"Action=http://192.168.9.49/AMS/Pages/Login.aspx?ReturnUrl=%2fAMS%2fDefault.aspx",
"Method=POST",
"RecContentType=text/html",
"Referer=http://192.168.9.49/AMS/Pages/Login.aspx?ReturnUrl=%2fAMS%2fDefault.aspx",
"Snapshot=t2.inf",
"Mode=HTML",
ITEMDATA,
"Name=__VIEWSTATE", "Value={Siebel_Analytic_ViewState2}", ENDITEM,
"Name=txtUid", "Value=admin", ENDITEM,
"Name=txtPwd", "Value=123", ENDITEM,
"Name=btnLogin", "Value=Login", ENDITEM,
"Name=__EVENTVALIDATION", "Value=/wEWBQLJjcg3Av/61tUCAp37up0OAoLch4YMApD0z+sFP89HDhPau2UuK4dkWGkCCJQmljU=", ENDITEM,
EXTRARES,
"Url=../_Javascript/mootools.js", "Referer=http://192.168.9.49/AMS/Pages/index.html", ENDITEM,
"Url=../_Style/common.css", "Referer=http://192.168.9.49/AMS/Pages/cp_frame.html", ENDITEM,
"Url=../_Style/basic.css", "Referer=http://192.168.9.49/AMS/Pages/cp_frame.html", ENDITEM,
"Url=../_Images/footer_back.jpg", "Referer=http://192.168.9.49/AMS/Pages/cp_frame.html", ENDITEM,
"Url=../_Images/nav_back.jpg", "Referer=http://192.168.9.49/AMS/Pages/top_frame.html", ENDITEM,
"Url=../_Images/header_back.jpg", "Referer=http://192.168.9.49/AMS/Pages/top_frame.html", ENDITEM,
"Url=../_Images/nav_back_2.gif", "Referer=http://192.168.9.49/AMS/Pages/left_frame.html", ENDITEM,
"Url=../_Images/blue_direct.gif", "Referer=http://192.168.9.49/AMS/Pages/left_frame.html", ENDITEM,
"Url=../_Images/hide.gif", "Referer=http://192.168.9.49/AMS/Pages/left_frame.html", ENDITEM,
"Url=../_Images/show.gif", "Referer=http://192.168.9.49/AMS/Pages/left_frame.html", ENDITEM,
"Url=../_Images/active_back_left.jpg", "Referer=http://192.168.9.49/AMS/Pages/top_frame.html", ENDITEM,
"Url=../_Images/active_back_right.jpg", "Referer=http://192.168.9.49/AMS/Pages/top_frame.html", ENDITEM,
"Url=../_Images/normal_back_left.jpg", "Referer=http://192.168.9.49/AMS/Pages/top_frame.html", ENDITEM,
"Url=../_Images/normal_back_right.jpg", "Referer=http://192.168.9.49/AMS/Pages/top_frame.html", ENDITEM,
"Url=../_Images/nav_back_active_2.gif", "Referer=http://192.168.9.49/AMS/Pages/left_frame.html", ENDITEM,
LAST);
web_submit_data("menus.aspx",
"Action=http://192.168.9.49/AMS/Pages/Menu/menus.aspx",
"Method=POST",
"RecContentType=text/html",
"Referer=http://192.168.9.49/AMS/Pages/top_frame.html",
"Snapshot=t3.inf",
"Mode=HTML",
ITEMDATA,
LAST);
web_submit_data("user.aspx",
"Action=http://192.168.9.49/AMS/Pages/Menu/user.aspx",
"Method=POST",
"RecContentType=text/html",
"Referer=http://192.168.9.49/AMS/Pages/top_frame.html",
"Snapshot=t4.inf",
"Mode=HTML",
ITEMDATA,
LAST);
web_submit_data("role.aspx",
"Action=http://192.168.9.49/AMS/Pages/Menu/role.aspx",
"Method=POST",
"RecContentType=text/html",
"Referer=http://192.168.9.49/AMS/Pages/top_frame.html",
"Snapshot=t5.inf",
"Mode=HTML",
ITEMDATA,
LAST);
return 0;
} 请各位大虾们指点一下吧。正在焦急测试中。。。。。 {Siebel_Analytic_ViewState2}是你做的关联? 把脚本切换到树形状态下,里面有服务器的返回信息 没有返回信息。
回复 3# 的帖子
是自动关联 你这个脚本回放应该是有问题的,注意这里"Name=__EVENTVALIDATION", "Value=/wEWBQLJjcg3Av/61tUCAp37up0OAoLch4YMApD0z+sFP89HDhPau2UuK4dkWGkCCJQmljU=", ENDITEM,
显然是一般web开发在表单提交时所作的提交动作的有效性验证,用来避免提交失效的表单
多打开几次这个登录页面,观察源代码中__EVENTVALIDATION这个域的value,是不是每次都不同的?如果答案是肯定的,你需要把该value关联一下,这样提交才会成功 同意楼上的
建议全部手动关联处理试试
页:
[1]