|
写了一个脚本,提交表单数据,但一直提示无法找到该表单,请帮助看看什么问题。
脚本如下:Action()
{
char usertoken[32];
char Authenticator[512]={0};
//保存返回usertoken
web_reg_save_param("usertoken",
"LB=CTCGetAuthInfo('",
"RB=')",
LAST);
web_url("index.jsp",
"URL=http://10.42.109.12:8080/iptvepg/platform/index.jsp?UserID=test&Action=Login",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t1.inf",
"Mode=HTML",
LAST);
//加密usertoken
CTCGetAuthInfo(usertoken,Authenticator);
//将加密好的authenticator提交
web_submit_form("auth.jsp",
"Frame=authform",
"Action=auth.jsp",
"Snapshot=t2.inf",
STARTHIDDENS,
"Name=UserID","Value=test",ENDITEM,
"Name=Authenticator","Value={Authenticator}",ENDITEM,
"Name=StbIP","Value=10.42.110.50",ENDITEM,
"Name=LastTermno","Value=2",ENDITEM,
ENDHIDDENS,
LAST);
return 0;
}
页面http://10.42.109.12:8080/iptvepg/platform/index.jsp代码如下: <!-- get encrypt token -->
<html>
<head>
<script language="javascript" type="">
function DoAuth()
{
if (typeof(Authentication) == "object" && "CTCGetAuthInfo" in Authentication)
{
document.authform.Authenticator.value = Authentication.CTCGetAuthInfo('@@nvet0w_ZRt5T_ctWLTNUeTZRA6tpTg');
document.authform.submit();
}
else
{
// handle error. "Authentication is not supported by current browser"
window.location = "/iptvepg" + "/errorHandler.jsp?" + "tips" + "=EPGActM0301";
}
}
</script>
</head>
<body bgcolor="#000000" onload="DoAuth()">
<!-- loading page -->
<div style="left:120; top:390;width:400;height:32; position:absolute">
<center>
<font color="#ffffff" size="6"><b>正在进入,请稍候…</b></font><!--???????????????ò...-->
</center>
</div>
<form action="auth.jsp" name="authform" method="post">
<input type="hidden" name="UserID" value="zte">
<input type="hidden" name="Authenticator" value="">
<input type="hidden" name="StbIP" value="10.42.119.77">
<input type="hidden" name="LastTermno" value="2">
</form>
</body>
</html>
loadrunner运行报错信息:Virtual User Script started
Starting action vuser_init.
Web Turbo Replay of LoadRunner 8.1.0 for WINXP; Web build 4788 [MsgId: MMSG-27143]
Run-Time Settings file: "D:\Program Files\Mercury\LoadRunner\scripts\http\\default.cfg" [MsgId: MMSG-27141]
Ending action vuser_init.
Running Vuser...
Starting iteration 1.
Starting action Action.
Action.c(7): Registering web_reg_save_param was successful [MsgId: MMSG-26390]
Action.c(11): web_url("index.jsp") was successful, 1307 body bytes, 214 header bytes [MsgId: MMSG-26386]
Action.c(22): Error -27979: Requested form not found [MsgId: MERR-27979]Action.c(22): web_submit_form("auth.jsp") highest severity level was "ERROR", 0 body bytes, 0 header bytes [MsgId: MMSG-26388]
Ending action Action.
Ending iteration 1.
Ending Vuser...
Starting action vuser_end.
Ending action vuser_end.
Vuser Terminated.
[ 本帖最后由 dxf_michael 于 2009-1-8 12:33 编辑 ] |
|