请教,关于lr的参数化问题。先谢谢啦!
现阶段正在测试一个.Net开发的C/S架构(client-database),后台是Sql Server数据库的产品(类似于QQ模式)要对该产品进行并发用户测试
使用Protocol advisor,推荐使用:Web Services,Microsoft .NET和COM/DCOM协议。
我选择LR的MicroNet协议
录制脚本,如下:
namespace Script {
using LoadRunner;
using Mercury.LoadRunner.DotNetProtocol.Replay;
using System;
using System.Data;
public partial class VuserClass {
public virtual int Action() {
lr.log("Event 1: new DataSet();");
DataSet_1 = new DataSet();
lr.log("Event 2: DataSet_1.ReadXml(\"input\\\\input1\");");
XmlReadModeRetVal = DataSet_1.ReadXml("input\\input1");
lr.think_time(20);
lr.log("Event 3: new DataSet();");
DataSet_2 = new DataSet();
lr.log("Event 4: DataSet_2.ReadXml(\"input\\\\input2\");");
XmlReadModeRetVal = DataSet_2.ReadXml("input\\input2");
lr.log("Event 5: new DataSet();");
DataSet_3 = new DataSet();
lr.log("Event 6: DataSet_3.ReadXml(\"input\\\\input3\");");
XmlReadModeRetVal = DataSet_3.ReadXml("input\\input3");
lr.log("Event 7: new DataSet();");
DataSet_4 = new DataSet();
lr.log("Event 8: DataSet_4.ReadXml(\"input\\\\input4\");");
XmlReadModeRetVal = DataSet_4.ReadXml("input\\input4");
return 0;
}
}
}
问题:
1.请问要对该产品进行并发用户测试,通过查看录制的脚本,选择MicroNet协议是否正确呢?
如果不正确,应该选择什么协议呢?
(我还用过windows sockets和Web Services协议录制过,脚本在最下方)
2.如果选择的协议正确,
请问要想参数化,就要通过.NET开发环境的.NET插件创建.NET虚拟用户是么?
3.LoadRunner9.5只支持VS2005(.net2.0)环境么?
4.如果LR9.5只支持Framework2.0,那么我本机的Framework是3.5,是不是就要卸载掉才可以呢?
5.用.NET创建虚拟用户,要对.NET编程掌握多少呢?
以下脚本是用windows sockets协议录制的
#include "lrs.h"
Action()
{
lrs_create_socket("socket0", "TCP", "RemoteHost=JJA-VSERVER:8888",LrsLastArg);
lrs_send("socket0", "buf0", LrsLastArg);
return 0;
}
以下脚本是用Web Services协议录制的
Action()
{
web_add_header("Content-Type", "text/xml; charset=utf-8");
web_add_header("SOAPAction", "\"http://tempuri.org/IService/GetServerList\"");
web_add_header("User-Agent", "Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client Protocol 2.0.50727.1873)");
soap_request("StepName=GetServerList",
"URL=http://10.52.232.170:8088/Service.svc",
"SOAPEnvelope=<?xml version=\"1.0\" encoding=\"GBK\" standalone=\"no\"?"
"><soap:Envelope xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns"
":xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:soap=\"http:/"
"/schemas.xmlsoap.org/soap/envelope/\"><soap:Body><GetServerList xmlns="
"\"http://tempuri.org/\"/></soap:Body></soap:Envelope>",
"Snapshot=t1.inf",
"ResponseParam=response",
LAST);
return 0;
}
[ 本帖最后由 bh95 于 2010-8-10 11:37 编辑 ] 我是来看答案的
页:
[1]