51Testing软件测试论坛

标题: get请求返回二进制应答 通过应答大小来判断是否正确 [打印本页]

作者: lizhilizhi28112    时间: 2010-5-7 19:18
标题: get请求返回二进制应答 通过应答大小来判断是否正确
用url请求获得应答(二进制文件),想通过应答大小来判断应答是否正确。
脚本主要内容如下:我想通过将应答存到参数aabb中,再通过web_save_param_length来得到应答的大小,呵呵,下面是我的脚本,应该有问题。
web_reg_save_param("aabb",
                "LB=",
                "RB=",
                "Search=body",
                LAST);

        web_url("route",
                "URL=http://111.22.33.134:7150/route?X11=116.3531711&Y1=39.9020295&X2=116.3747060&Y2=39.9054908&Vers=2.0",
                "Resource=1",
                "RecContentType=application/octet-stream",
                "Referer=",
                "Snapshot=t1.inf",
                LAST);
web_save_param_length( "{aabb}", "Base=Hexadecimal", LAST);



loadrunner的回放日志如下:
Starting iteration 1.
Starting action Action.
Action.c(18): Registering web_reg_save_param was successful          [MsgId: MMSG-26390]
Action.c(24): t=382ms: 97-byte response headers for "http://172.17.40.161:7150/route?X11=116.3531711&Y1=39.9020295&X2=116.3747060&Y2=39.9054908&Vers=2.0" (RelFrameId=1, Internal ID=1)
Action.c(24):     HTTP/1.0 200 OK\r\n
Action.c(24):     Content-Type: application/octet-stream\r\n
Action.c(24):     Connection: close\r\n
Action.c(24):     Content-Length: 8\r\n
Action.c(24):     \r\n
Action.c(24): t=402ms: 8-byte response body for "http://172.17.40.161:7150/route?X11=116.3531711&Y1=39.9020295&X2=116.3747060&Y2=39.9054908&Vers=2.0" (RelFrameId=1, Internal ID=1)
Action.c(24):     \x08\x00\x00\x01\x04\x00\x00\x00
Action.c(24): Notify: Saving Parameter "aabb = \x08\x00\x00\x01\x04\x00\x00"
Action.c(24): web_url("route") was successful, 8 body bytes, 97 header bytes          [MsgId: MMSG-26386]
Action.c(37): Warning -26202: Value of the "{aabb}" parameter could not be obtained (Parameter_GetParameterExt rc=-1)          [MsgId: MWAR-26202]
Action.c(37): web_save_param_length highest severity level was "warning"          [MsgId: MMSG-26391]
Ending action Action.
Ending iteration 1.
Ending Vuser...
Starting action vuser_end.
Ending action vuser_end.
Vuser Terminated.

请问我怎么改改我的脚本,是不是这种方法行不通啊??




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2