leomoun 发表于 2013-1-24 18:26:52

回放时成功,但controller中运行时出错

脚本如下:
Action()
{
        web_submit_data("login",
                "Action= http://IP:PORT/Mobile/login",
                "Method=POST",
                ITEMDATA,
                "Name=appcode","Value=10021",ENDITEM,
                "Name=reqstr","Value={reqstr}",ENDITEM,
                "Name=verify","Value={verify}",ENDITEM,
                "Name=datatype","Value=j",ENDITEM,
                LAST);

        return 0;
}
回放时是成功的,但是在controller中运行的时候就提示:Warning: The string 'verify' with parameter delimiters is not a parameter.
verify参数没有取到值,具体的日志如下:

Virtual User Script started       
Starting action vuser_init.       
Web Turbo Replay of LoadRunner 9.50 for WINXP; WebReplay9a build 6220 (Dec 28 2008 17:01:56)       
Run Mode: HTML       
Run-Time Settings file: "C:\Documents and Settings\Administrator\Local Settings\Temp\lr5tmpdir5FX.870\lrcfgSI3.871\cfgMc6.885"       
Ending action vuser_init.       
Running Vuser...       
Starting iteration 1.       
Starting action Action.       
Action.c(4): Notify: Parameter Substitution: parameter "reqstr" ="dXNlcj15YW5ncEBuZXQtZWFzdC5jb20mcGFzc3dvcmQ9ZTEwYWRjMzk0OWJhNTlhYmJlNTZlMDU3ZjIwZjg4M2U="       
Action.c(4): Warning: The string 'verify' with parameter delimiters is not a parameter.       
Action.c(4): t=246ms: 470-byte response headers for "http://IP:PORT/Mobile/login" (RelFrameId=1, Internal ID=1)
Action.c(4):   HTTP/1.1 200 OK\r\n
Action.c(4):   Date: Thu, 24 Jan 2013 10:17:32 GMT\r\n
Action.c(4):   Server: Apache/2.2.15 (CentOS)\r\n
Action.c(4):   X-Powered-By: PHP/5.3.3\r\n
Action.c(4):   Set-Cookie: PHPSESSID=67ve57hiope3mv76k0bpoue004; path=/\r\n
Action.c(4):   Expires: Thu, 19 Nov 1981 08:52:00 GMT\r\n
Action.c(4):   Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0\r\n
Action.c(4):   Pragma: no-cache\r\n
Action.c(4):   Set-Cookie: think_template=default; expires=Thu, 17-Feb-2056 21:35:04 GMT; path=/\r\n
Action.c(4):   Content-Length: 48\r\n
Action.c(4):   Connection: close\r\n
Action.c(4):   Content-Type: text/html; charset=UTF-8\r\n
Action.c(4):   \r\n
Action.c(4): t=247ms: 48-byte response body for "http://IP:PORT/Mobile/login" (RelFrameId=1, Internal ID=1)
Action.c(4):   {"code":"103","description":"verify is invalid"}
Action.c(4): web_submit_data("login") was successful, 48 body bytes, 470 header bytes       
Ending action Action.       
Ending iteration 1.       
Ending Vuser...       
Starting action vuser_end.       
Ending action vuser_end.       
Vuser Terminated.       
Vuser 0 (thread 4504), ended OK."       

请问这是什么原因呢?Run-time settings在回放和controller中设置是一致的。

leomoun 发表于 2013-1-25 10:50:21

请问没人遇到过这种问题吗?

jacksboy 发表于 2013-1-27 10:26:09

在设置里有个参数的边界符号你设的是{么

stevenremember 发表于 2013-1-28 14:20:15

多数情况是:1 如果参数化里的设置出错,取不到值就会报这个错
                  2 关联的数据没有找到,左右边界问题

回放脚本的时候仔细看下Replay log
页: [1]
查看完整版本: 回放时成功,但controller中运行时出错