|
2#
楼主 |
发表于 2009-3-3 11:36:59
|
只看该作者
使用LR8.1的Microsoft.net协议录制c/s结果的程序
我的代码如下:
namespace Script {
using LoadRunner;
using Mercury.LoadRunner.DotNetProtocol.Replay;
using System;
using System.Collections.Generic;
using System.Data;
using System.Globalization;
using YnTravelSky.RAMSystem.Entities.Order;
using YnTravelSky.RAMSystem.Entities.Payment;
using YnTravelSky.RAMSystem.Server.Booking;
using YnTravelSky.RAMSystem.Server.EasyFare;
using YnTravelSky.RAMSystem.Server.Framework;
using YnTravelSky.RAMSystem.Server.Management;
public partial class VuserClass {
public virtual int Action() {
lr.log("Event 1: ((Crew)(Activator.GetObject(typeof(YnTravelSky.RAMSystem.Server.Manageme" +
"nt.Crew), \"tcp://192.17.25.2:8080/Crew\", null)));");
Crew_1 = ((Crew)(Activator.GetObject(typeof(YnTravelSky.RAMSystem.Server.Management.Crew), "tcp://192.17.25.2:8080/Crew", null)));
String url_1;
url_1 = "tcp://192.17.25.2:8080/PublicMethodForBasicData";
lr.log("Event 2: ((PublicMethodForBasicData)(Activator.GetObject(typeof(YnTravelSky.RAMSy" +
"stem.Server.Framework.PublicMethodForBasicData), url_1, null)));");
PublicMethodForBasicData_1 = ((PublicMethodForBasicData)(Activator.GetObject(typeof(YnTravelSky.RAMSystem.Server.Framework.PublicMethodForBasicData), url_1, null)));
lr.think_time(11);
lr.log("Event 3: Crew_1.StaffLogin(\" + lr.eval_string("{username}") + "\", \"123456\", \"HKG01\");");
StringArray_1 = Crew_1.StaffLogin("" + lr.eval_string("{username}") + " "", "123456", "HKG01");
红色部分是我的登录名=staff015
lr.log("Event 4: PublicMethodForBasicData_1.GetRouteRecnoByDefaultPort(\"HKG\");");
Int32RetVal = PublicMethodForBasicData_1.GetRouteRecnoByDefaultPort("HKG");
lr.log("Event 5: ((UserLogin)(Activator.GetObject(typeof(YnTravelSky.RAMSystem.Server.Fra" +
"mework.UserLogin), \"tcp://192.17.25.2:8080/UserLogin\", null)));");
UserLogin_1 = ((UserLogin)(Activator.GetObject(typeof(YnTravelSky.RAMSystem.Server.Framework.UserLogin), "tcp://192.17.25.2:8080/UserLogin", null)));
lr.log("Event 6: UserLogin_1.GetServiveDateTime();");
DateTimeRetVal = UserLogin_1.GetServiveDateTime();
lr.log("Event 7: UserLogin_1.GetControlRefundOrAmendForPrintTicket();");
BooleanRetVal = UserLogin_1.GetControlRefundOrAmendForPrintTicket();
lr.log("Event 8: UserLogin_1.GetUserPower(209);//这里的209就是staff015对应的usernumber
DataTable_1 = UserLogin_1.GetUserPower(209) ;//这里的209就是staff015对应的usernumber
……
请大家不吝赐教,小女子感激不尽!!!!!
[ 本帖最后由 lsl20032 于 2009-3-3 12:47 编辑 ] |
|