loadrunner测试C/S结构
#include "lrs.h"Action()
{
lrs_create_socket("socket0", "TCP", "LocalHost=0", "RemoteHost=192.168.0.208:8080",LrsLastArg);
lrs_send("socket0", "buf0", LrsLastArg);
lrs_receive("socket0", "buf1", LrsLastArg);
lrs_create_socket("socket1", "TCP", "LocalHost=5060", "Backlog=64",LrsLastArg);
lrs_create_socket("socket2", "TCP", "LocalHost=5060", "Backlog=64",LrsLastArg);
lrs_create_socket("socket3", "TCP", "LocalHost=5060", "Backlog=64",LrsLastArg);
lrs_create_socket("socket4", "TCP", "LocalHost=0", "Backlog=1",LrsLastArg);
lrs_close_socket("socket4");
lrs_create_socket("socket5", "UDP", "LocalHost=5060",LrsLastArg);
lrs_send("socket5", "buf2", "TargetSocket=LINUX:5060", LrsLastArg);
lrs_create_socket("socket6", "TCP", "RemoteHost=LINUX:5060",LrsLastArg);
lrs_close_socket("socket6");
return 0;
}
大家看看我的loadrunner测试C/S的脚本,我测试的是一个相似QQ的客户端软件,选的是windows sockets协议,但不知道在哪里设置参数啊,大家有loadrunner测试C/S的资料吗?上网好像很少找到这类的资料,大家帮帮忙
接上,还有这东西,都没资料介绍,不知道如何动笔
;WSRData 2 1sendbuf0 144
"GET /hsc/clientcmd?action=2000&userid=13145210&password=123 HTTP/1.1\r\n"
"User-Agent: Nimo Software HTTP Retriever 1.0\r\n"
"Host: 192.168.0.208:8080\r\n"
"\r\n"
recvbuf1 1585
"HTTP/1.1 200 OK\r\n"
"Server: Apache-Coyote/1.1\r\n"
"Cache-Control: no-cache\r\n"
"Content-Type: text/xml;charset=utf-8\r\n"
"Transfer-Encoding: chunked\r\n"
"Date: Tue, 12 Jun 2007 21:07:24 GMT\r\n"
"\r\n"
"577\r\n"
"<?xml version=\"1.0\" encoding=\"utf-8\"?><hsc-mccs><cmd id=\"2000\"><elem"
"ent><result>1</result><popedom>1</popedom><SoftXIP>null</SoftXIP><softphon"
"e>1101</softphone><screenmix><scrformat>4</scrformat><member big=\"1\">806"
"23623</member><member big=\"0\">80623624</member><member big=\"0\">8062362"
"5</member><member big=\"0\">80623626</member></screenmix><music><name code"
" =\"\">6</name></music><department><depart name=\"MS\" id=\"10000230\"><me"
"mber id=\"10002080\">1102</member><member id=\"10003087\">1104</member><me"
"mber id=\"10003090\">1105</member><member id=\"10002087\">1103</member><me"
"mber id=\"13145210\">1101</member><member id=\"10003092\">Jun</member></de"
"part><depart name=\"CCS\" id=\"10001876\"><member id=\"10000603\">9905</me"
"mber><member id=\"10001438\">9906</member><member id=\"10003263\">9902</me"
"mber><member id=\"10000602\">9904</member><member id=\"10000601\">9903</me"
"mber><member id=\"10002504\">xiacl</member></depart><depart name=\"hr\" id"
"=\"10003000\"></depart><depart name=\"yy\" id=\"10003002\"></depart><depar"
"t name=\"tt\" id=\"10003004\"></depart></department><LoginUserInfo><accoun"
"ts>13145210</accounts><username>1101</username><figure>13145210</figure><c"
"ompany>鍗庢"
"\x80"
"濆垱</company><dept>MS</dept><departmentID>10000230</departmentID><positio"
"n>null</position><email>jun@163.com</email><phone1>210</phone1><phone2>nul"
"l</phone2><phone3>null</phone3><ringtype>2</ringtype><area>null</area></Lo"
"ginUserInfo></element></cmd></hsc-mccs>\r\n"
"\r\n"
"0\r\n"
"\r\n"
sendbuf2 1936
"REGISTER sip:192.168.0.218 SIP/2.0\r\n"
"From: sip:6608@192.168.0.218;tag=66ee2ed6\r\n"
"To: sip:6608@192.168.0.218\r\n"
"Call-Id: 15a54cc6e9a921bfd9de789a96489b02\r\n"
"Cseq: 101 REGISTER\r\n"
"Contact: <sip:6608@10.56.58.59;LINEID=641d48d4083e178e15f7817c53c6a53b>\r\n"
"Expires: 300\r\n"
"Date: Tue, 12 Jun 2007 07:07:17 GMT\r\n"
"Max-Forwards: 20\r\n"
"User-Agent: sipXezPhone\r\n"
"Accept-Language: en\r\n"
"Supported: replaces\r\n"
"Via: SIP/2.0/UDP 10.56.58.59;branch=z9hG4bK-f76697a54892c30e046b537df5271f"
"45;rport\r\n"
"Content-Length: 0\r\n"
"\r\n"
"REGISTER sip:192.168.0.218 SIP/2.0\r\n"
"From: sip:6608@192.168.0.218;tag=66ee2ed6\r\n"
"To: sip:6608@192.168.0.218\r\n"
"Call-Id: 15a54cc6e9a921bfd9de789a96489b02\r\n"
"Cseq: 101 REGISTER\r\n"
"Contact: <sip:6608@10.56.58.59;LINEID=641d48d4083e178e15f7817c53c6a53b>\r\n"
"Expires: 300\r\n"
"Date: Tue, 12 Jun 2007 07:07:17 GMT\r\n"
"Max-Forwards: 20\r\n"
"User-Agent: sipXezPhone\r\n"
"Accept-Language: en\r\n"
"Supported: replaces\r\n"
"Via: SIP/2.0/UDP 10.56.58.59;branch=z9hG4bK-f76697a54892c30e046b537df5271f"
"45;rport\r\n"
"Content-Length: 0\r\n"
"\r\n"
"REGISTER sip:192.168.0.218 SIP/2.0\r\n"
"From: sip:6608@192.168.0.218;tag=66ee2ed6\r\n"
"To: sip:6608@192.168.0.218\r\n"
"Call-Id: 15a54cc6e9a921bfd9de789a96489b02\r\n"
"Cseq: 101 REGISTER\r\n"
"Contact: <sip:6608@10.56.58.59;LINEID=641d48d4083e178e15f7817c53c6a53b>\r\n"
"Expires: 300\r\n"
"Date: Tue, 12 Jun 2007 07:07:17 GMT\r\n"
"Max-Forwards: 20\r\n"
"User-Agent: sipXezPhone\r\n"
"Accept-Language: en\r\n"
"Supported: replaces\r\n"
"Via: SIP/2.0/UDP 10.56.58.59;branch=z9hG4bK-f76697a54892c30e046b537df5271f"
"45;rport\r\n"
"Content-Length: 0\r\n"
"\r\n"
"REGISTER sip:192.168.0.218 SIP/2.0\r\n"
"From: sip:6608@192.168.0.218;tag=66ee2ed6\r\n"
"To: sip:6608@192.168.0.218\r\n"
"Call-Id: 15a54cc6e9a921bfd9de789a96489b02\r\n"
"Cseq: 101 REGISTER\r\n"
"Contact: <sip:6608@10.56.58.59;LINEID=641d48d4083e178e15f7817c53c6a53b>\r\n"
"Expires: 300\r\n"
"Date: Tue, 12 Jun 2007 07:07:17 GMT\r\n"
"Max-Forwards: 20\r\n"
"User-Agent: sipXezPhone\r\n"
"Accept-Language: en\r\n"
"Supported: replaces\r\n"
"Via: SIP/2.0/UDP 10.56.58.59;branch=z9hG4bK-f76697a54892c30e046b537df5271f"
"45;rport\r\n"
"Content-Length: 0\r\n"
"\r\n"
sendbuf3 131
"GET /hsc/clientcmd?action=2004&userid=13145210 HTTP/1.1\r\n"
"User-Agent: Nimo Software HTTP Retriever 1.0\r\n"
"Host: 192.168.0.208:8080\r\n"
"\r\n"
recvbuf4 641
"HTTP/1.1 200 OK\r\n"
"Server: Apache-Coyote/1.1\r\n"
"Cache-Control: no-cache\r\n"
"Content-Type: text/xml;charset=utf-8\r\n"
"Transfer-Encoding: chunked\r\n"
"Date: Tue, 12 Jun 2007 21:07:40 GMT\r\n"
"\r\n"
"1c7\r\n"
"<?xml version=\"1.0\" encoding=\"utf-8\"?><hsc-mccs><cmd id=\"2004\"><elem"
"ent><result>1</result><memberinfo><accounts>13145210</accounts><username>1"
"101</username><figure>13145210</figure><company>鍗庢"
"\x80"
"濆垱</company><dept>MS</dept><departmentID>10000230</departmentID><positio"
"n>null</position><email>jun@163.com</email><phone1>210</phone1><phone2>nul"
"l</phone2><phone3>null</phone3><ringtype>2</ringtype><area>null</area></me"
"mberinfo></element></cmd></hsc-mccs>\r\n"
"\r\n"
"0\r\n"
"\r\n"
sendbuf5 131
"GET /hsc/clientcmd?action=2004&userid=13145210 HTTP/1.1\r\n"
"User-Agent: Nimo Software HTTP Retriever 1.0\r\n"
"Host: 192.168.0.208:8080\r\n"
"\r\n"
recvbuf6 641
"HTTP/1.1 200 OK\r\n"
"Server: Apache-Coyote/1.1\r\n"
"Cache-Control: no-cache\r\n"
"Content-Type: text/xml;charset=utf-8\r\n"
"Transfer-Encoding: chunked\r\n"
"Date: Tue, 12 Jun 2007 21:07:40 GMT\r\n"
"\r\n"
"1c7\r\n"
"<?xml version=\"1.0\" encoding=\"utf-8\"?><hsc-mccs><cmd id=\"2004\"><elem"
"ent><result>1</result><memberinfo><accounts>13145210</accounts><username>1"
"101</username><figure>13145210</figure><company>鍗庢"
"\x80"
"濆垱</company><dept>MS</dept><departmentID>10000230</departmentID><positio"
"n>null</position><email>jun@163.com</email><phone1>210</phone1><phone2>nul"
"l</phone2><phone3>null</phone3><ringtype>2</ringtype><area>null</area></me"
"mberinfo></element></cmd></hsc-mccs>\r\n"
"\r\n"
"0\r\n"
"\r\n"
-1 up,我在测试一个c/s的三层程序,录制的脚本总是有乱码,java编写的 就是在DATA文件中设置参数 有这方面介绍的资料吗?好无助啊
华人天堂好靓
华人天堂好靓 我也在测CS的基本上是没什么进展,也没地方参数化
并且一编译LR就挂掉 我有LR测C/S的资料...都是论坛里下的啊,,,你自己找找,很多的...:)
我也不知道怎么上传...!
回复
CS的测试起来很麻烦的,呵呵!CS测试
以前也是做些B/S架构的测试 WEB测试现在突然要做网络监控系统(”电子眼“),很无助啊!。。
华人天堂不知道你现在对这些方面的测试有些经验了吗?
请加QQ:18103135 我现在测cs结构连脚本都录制不出来啊
明明是ms sql的后台数据库
无论选什么协议都录制不出脚本是不是loadrunner版本的问题??
我现在用的是7.8版的
建议采用绝编码的方式来实现。
1.可以做一个WEB页面,其中实对SQL的动态执行。2.可以将C/S的业务写成DLL,用lr_load_dll()调用,实现测试。
3.如是支持dotNet,直接使用VS开发工具进行编写。
以上,如自已实现有困难,可以让开发人员协助。
(建议自已实现,这样会有很大的提高) 我本来是搞开发的现在需要测试一个c/s的应用程序的性能,用的就是loadrunner 但是不会啊,有没有高手指点指点啊? 本人不胜感激啊。。。。谢谢了:Q 我QQ:510179469; 最近也在做C/S架构的即时通讯工具的性能测试,用loadrunner录制的脚本如楼主一样,无从下手。不知楼主以前是怎么做的 我建议你仔细询问开发整个通信过程是怎么样的。让他们给你把时序图画出来,然后就是问清楚通信的协议是怎么样的。。所发的数据包有哪些字段需要测试注意。。。我在上面都看到用户名了。。呵呵。。不知道对不对哦。。。密码估计加密了。。或者隐藏了。。。如果是加密的话,可以将他们的加密程序做成dll 调用,然后在 data 里参数化 就可以实现并发测试了。。。我在data 里看到了 http ,建议你用 多协议,一个是 http 一个是 socket。 发送的数据包可以根据你所测软件的协议 自动生成,接收到的数据包可以根据开发的意见 检查特殊字段即可。。。 data.ws中是发送和接受的数据包的内容,send buf是LR向服务器发送的数据包内容,recv buf是从服务器返回的数据包的内容,send buf和recv buf后边的数字代表这个数据包的长度,每次执行脚本 LR会比较recv的数据包的大小即recv buf后边的数字是否一致,而不是recv buf的内容,所以个人认为recv buf不用太在意,LZ要做参数化的话,只要在相应的send buf中找到相应的数据就行了
页:
[1]