51Testing软件测试论坛
标题:
c/S架构的tcp/ip协议的用LR录制后这样怎么参数化
[打印本页]
作者:
ysf19841002@163
时间:
2012-3-18 12:59
标题:
c/S架构的tcp/ip协议的用LR录制后这样怎么参数化
脚本
include "lrs.h"
Action()
{
lrs_create_socket("socket0", "TCP", "RemoteHost=211.154.145.245:80", LrsLastArg);
lrs_send("socket0", "buf0", LrsLastArg);
lrs_receive("socket0", "buf1", LrsLastArg);
lrs_close_socket("socket0");
lrs_create_socket("socket1", "TCP", "RemoteHost=211.154.145.245:8888", LrsLastArg);
lrs_send("socket1", "buf2", LrsLastArg);
lrs_receive("socket1", "buf3", LrsLastArg);
lr_think_time(11);
lrs_send("socket1", "buf4", LrsLastArg);
lrs_receive("socket1", "buf5", LrsLastArg);
lrs_send("socket1", "buf6", LrsLastArg);
lrs_receive("socket1", "buf7", LrsLastArg);
lrs_send("socket1", "buf8", LrsLastArg);
lrs_receive("socket1", "buf9", LrsLastArg);
lrs_send("socket1", "buf10", LrsLastArg);
lrs_receive("socket1", "buf11", LrsLastArg);
lrs_send("socket1", "buf12", LrsLastArg);
lrs_receive("socket1", "buf13", LrsLastArg);
lrs_send("socket1", "buf14", LrsLastArg);
lrs_receive("socket1", "buf15", LrsLastArg);
lrs_send("socket1", "buf16", LrsLastArg);
lrs_receive("socket1", "buf17", LrsLastArg);
lrs_send("socket1", "buf18", LrsLastArg);
lrs_receive("socket1", "buf19", LrsLastArg);
lrs_send("socket1", "buf20", LrsLastArg);
lrs_receive("socket1", "buf21", LrsLastArg);
lrs_send("socket1", "buf22", LrsLastArg);
lrs_receive("socket1", "buf23", LrsLastArg);
lrs_close_socket("socket1");
return 0;
}
Data.ws
;WSRData 2 1
send buf0 94
"GET //UpdateFileList.xml HTTP/1.1\r\n"
"Host: sctpzupdate.123123.com.cn\r\n"
"Connection: Keep-Alive\r\n"
"\r\n"
recv buf1 62436
"HTTP/1.1 200 OK\r\n"
"Content-Length: 62187\r\n"
"Content-Type: text/xml\r\n"
"Last-Modified: Fri, 16 Mar 2012 09:13:52 GMT\r\n"
"Accept-Ranges: bytes\r\n"
"ETag: \"d5a64f1b553cd1:e79\"\r\n"
"Server: Microsoft-IIS/6.0\r\n"
"X-Powered-By: ASP.NET\r\n"
"Date: Sat, 17 Mar 2012 10:19:08 GMT\r\n"
"\r\n"
"<?xml version=\"1.0\"?>\r\n"
\" o"
"recv buf7 572
".NET"
"\x01\x00\x02\x00\x00\x00"
","
"\x02\x00\x00\x00\x00\x00\x01\x00\x00\x00\xff\xff\xff\xff\x01\x00\x00\x00\x00"
"\x00\x00\x00\x16\x11\x10\x00\x00\x10\x01\x00\x00\x00\x01\x00\x00\x00"
"\t"
"\x02\x00\x00\x00"
"\f"
"\x03\x00\x00\x00"
"MSystem.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d5"
"0a3a"
"\x05\x02\x00\x00\x00"
"\"System.Web.Security.MembershipUser\r"
"\x00\x00\x00"
"\t_UserName"
"\x10"
"_ProviderUserKey"
"\x06"
"_Email"
"\x11"
"_PasswordQuestion\b_Comment\v_IsApproved\f_IsLockedOut"
"\x10"
"_LastLockoutDate\r_CreationDate"
"\x0e"
"_LastLoginDate"
"\x11"
"_LastActivityDate"
"\x18"
"_LastPasswordChangedDate\r_ProviderName"
"\x01\x02\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x01\x01\x01"
"\r\r\r\r\r"
"\x03\x00\x00\x00\x06\x04\x00\x00\x00"
"\t鏉ㄨ儨宄"
"\xb0"
"\t"
"\x05\x00\x00\x00"
"\n"
"\n"
"\x06\x06\x00\x00\x00\x00\x01\x00\x00\x80"
"坮[V璆"
"\x00\x98"
"\""
"\xda\x17"
"H0鸃"
"\x8d"
">椅H0鸃"
"\x8d"
">椅H0穾}虷"
"\x06"
"\a"
"\x00\x00\x00"
"\vSqlProvider"
"\x04\x05\x00\x00\x00"
"\vSystem.Guid\v"
"\x00\x00\x00\x02"
"_a"
"\x02"
"_b"
"\x02"
"_c"
"\x02"
"_d"
"\x02"
"_e"
"\x02"
"_f"
"\x02"
"_g"
"\x02"
"_h"
"\x02"
"_i"
"\x02"
"_j"
"\x02"
"_k"
"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
"\b\a\a"
"\x02\x02\x02\x02\x02\x02\x02\x02\x17"
"瑟"
"\xc7\x10"
"6,E坚訯j#"
"\xf0"
"&\v"
-1
作者:
nameslily
时间:
2012-3-19 11:25
这个参数化比较麻烦,首先你要找到要进行参数化的字段在Data.ws中出现在哪里,而且要参数所有在Data.ws中出现的。如果你本人找不到,建议去寻求开发的支持
作者:
云层
时间:
2012-3-19 12:08
明明是个Http协议干嘛非要用sockets来做呢?
作者:
superfang
时间:
2012-3-19 23:03
协议选择的不靠谱。 不明白为什么要这么做?
作者:
ysf19841002@163
时间:
2012-3-22 11:56
回复3楼
HTTP协议,录制的脚本是空的,你是刚学LR吗。这是c/s架构的
作者:
云层
时间:
2012-3-22 11:58
5#好吧你学了很久
作者:
liofz
时间:
2012-4-8 15:48
找到需要参数化的数据,然后在ws里进行参数化就可以,如果因为"\x02"这些找不到,可以转换回正常字符再参数化,转换方法论坛里面有
作者:
xiaoxiaoimg
时间:
2014-4-19 10:07
云层,悲剧啊
欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/)
Powered by Discuz! X3.2