loadrunner Lr_类函数之 lr_paramarr_len()

lr_paramarr_len()

返回参数数组中的元素数。
int lr_paramarr_len(const char * paramArrayName);

参数说明:
paramArrayName:参数数组的名称。
lr_paramarr_len返回参数数组中的元素数。

 

示例:lr_paramarr_idxlr_paramarr_len
此示例显示如何从参数数组获取最后一个值。
int arrSize;
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
* /
arrSize = lr_paramarr_len
(“outFlightVal”);
FlightVal = lr_paramarr_idx
(“outFlightVal”,arrSize;
// FlightVal
包含值“233; 309; 11/20/2003”。

相关文章
相关标签/搜索