Go to LoadRunner-join array of cyclic output

Source: Internet
Author: User

Web_reg_save_param: If the Ord parameter value is set to all, the correlated function automatically saves the correlated values that meet the conditions to the parameter array. In this example, if the correlated values return three records, LR stores the values in sor_1, sor_2, and sor_3 respectively. At the same time, LR will also automatically create a sor_count variable to save the total number of records. Here, the sor_count value is equal to 3.

Web_reg_save_param ("param1 ",

"LB = sor \" value = \"",

"RB = \"","Ord = all",

Last );

// Method 1 of the array associated with cyclic output
/For (I = 1; I <= atoi (lr_eval_string ("{param1_count}"); I ++)
{

Sprintf (buffer, "{param1 _ % d}", I); // save each sor value to the Sor string. when defining the buffer, defined as char buffer [100] = {0}
Lr_output_message ("The conut is % s", lr_eval_string (buffer); // you can use the lr_eval_string function to assign a string to the sorvalue variable.

}

Web_reg_save_param ("contactidlast ",

"LB = sor \" value = \"",

"RB = \"","Ord = all",

Last );

// Method 2 of array associated with cyclic output

Testi = atoi (lr_eval_string ("{contactidlast_count}"); // int testi;

For (I = 1; I <= testi)

{

Lr_save_int (testi, "itest ");

Contactidlastl = lr_eval_string ("{contactidlast _ {itest}"); // char * contactidlastl
Lr_output_message ("contactidlast = % s", lr_eval_string (contactidlastl ));

}

Go to LoadRunner-join array of cyclic output

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.