LoadRunner web_reg_save_param, ord=all, paramName_count issues

二次信任 提交于 2019-12-02 07:57:02

The problem is that you use a soon to be deprecated API web_reg_save_param which does not support the ParamName syntax. In this API the second parameter is always the parameter name and therefore the correct use would be:

web_reg_save_param(
"rotaPeople",
"LB=someText",
"RB=\")",
"Ord=ALL",
LAST);

The proper API to use is web_reg_save_param_ex which does support the syntax you used so the call should look like:

web_reg_save_param_ex(
"ParamName=rotaPeople",
"LB=someText",
"RB=\")",
"Ord=ALL",
LAST);

Then the rest of your code should work properly.

I am not sure what you are doing but you might want to take a look at the somewhat unknown API lr_paramarr_random which will automatically pull a random value from the parameters array.

user2484633

This should help you

   web_reg_save_param(
  "rotaPeople",
 "LB=someText",
 "RB=\")",
 "Ord=ALL",
  LAST);

  lr_output_message("PC:%d",atoi(lr_eval_string("{rotaPeople_count}")));

You are using ord=all,see the run time data which value you want to capture,If you want to capture the 10th value please use ord=10,automatically this warning will remove from output log.

teenaanie

Example for capturing an array of dynamic values:

Action()
{

int i;
int ncount;
char ParamName[100];

web_set_sockets_option("SSL_VERSION", "TLS");



    web_reg_save_param("trackingno","LB=;","RB= (NTN 0430)","search=All","ord=all",LAST);

    web_submit_data("barcode.pl", 
        "Action=http://qtetools.rmtc.fedex.com/barcode/cgi-bin/barcode.pl", 
        "Method=POST", 
        "TargetFrame=", 
        "RecContentType=text/html", 
        "Referer=http://qtetools.rmtc.fedex.com/barcode/html/barcode.shtml", 
        "Snapshot=t2.inf", 
        "Mode=HTML", 
        ITEMDATA, 
        "Name=formcode", "Value=0430", ENDITEM, 
        "Name=count", "Value=10", ENDITEM, 
        "Name=narrow", "Value=2", ENDITEM, 
        LAST);


    ncount= atoi(lr_eval_string("{trackingno_count}"));

    for (i =1;i <= ncount;i++)
       {
    sprintf(ParamName, "{trackingno_%d}", i);

       lr_output_message("Value of %s: %s",ParamName,lr_eval_string(ParamName));
           }
    return 0;
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!