문제

How to select a random parameter captured using

web_reg_save_param("varParamName",
                   "LB=value=\"",
                   "RB=\"",
                   "Ord=All",
                   LAST);
도움이 되었습니까?

해결책

Your LB and RB conditions are too generic. Pick something more specific to what you are trying to capture

To your greater question, there are several paths on picking an ordinal depending upon your version of LoadRunner. Something which works for every version would be

char foo[50];
...
sprintf(
     foo,
     "{varParamName_%d}",
     rand() * atoi( lr_eval_string("{varParamName_count}" ) ) +1
);
...
lr_save_string(
     lr_eval_string( foo ), 
     "LR_MyRandomCorrelatedvariable"
);
    ...
lr_output_message(
     "%s", 
     lr_eval_string( "{LR_MyRandomCorrelatedvariable}" ) 
);

다른 팁

to randomize the correlation values we can use lr_paramarr_random function.

web_reg_save_param("varParamName","LB=value=\"","RB=\"","Ord=All",LAST);

// some request ***web_submit_form()

//Save a randomly selected ID to a Parameter lr_save_string(lr_paramarr_random("varParamName"),"RandomParam");

now we can use RandomParam instead of varParamName. it will provide random values.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top