本文主要是介绍loadrunner Lr_类函数之 lr_paramarr_random(),希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
lr_paramarr_random()
返回参数数组中随机位置的参数值
char * lr_paramarr_random(const char * paramArrayName);
参数说明:
paramArrayName:参数数组的名称。
lr_paramarr_random返回一个字符串,其中包含参数数组中的参数值。该值从LoadRunner随机选择的位置的参数返回。
示例:lr_paramarr_random
此示例显示如何从参数数组获取随机值。
char * FlightVal;
web_reg_save_param(“outFlightVal”,
“LB =outboundFlight value =”,“RB =>”,
“ORD = ALL”,
“SaveLen = 18”,
LAST);
web_submit_form(“reservations.pl”,
“Snapshot =t4.inf”,
ITEMDATA,
“Name = depart”,“Value = London”,ENDITEM,
“Name =departDate”,“Value = 11/20/2003”,ENDITEM,
“Name =arrival”,“Value = New York”,ENDITEM,
“Name =returnDate”,“Value = 11/21/2003”,ENDITEM,
“Name =numPassengers”,“Value = 1”,ENDITEM,
“Name =roundtrip”,“Value = <OFF>”,ENDITEM,
“Name =seatPref”,“Value = None”,ENDITEM,
“Name =seatType”,“Value = Coach”,ENDITEM,
“name =findFlights.x”,“Value = 83”,ENDITEM,
“Name =findFlights.y”,“Value = 16”,ENDITEM,
LAST);
/ *
在web_submit_form之前调用web_reg_save_param的结果是:
通知:保存参数“outFlightVal_1 = 230; 378; 11/20/2003”
通知:保存参数“outFlightVal_2 = 231; 337; 11/20/2003”
通知:保存参数“outFlightVal_3 = 232; 357; 11/20/2003”
通知:保存参数“outFlightVal_4 = 233; 309; 11/20/2003”
通知:保存参数“outFlightVal_count = 4”
* /
FlightVal = lr_paramarr_random(“outFlightVal”);
这篇关于loadrunner Lr_类函数之 lr_paramarr_random()的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!