Highlighted
Absent Member.
Absent Member.
1563 views

Capturing high/low values of an array with Loadrunner

Does anyone know if there is a way to single out the high/low values of an array captured using web_reg_save_param? I'm trying to do some analysis of rate data and specifically need the low values of the captured array of data.
0 Likes
5 Replies
Highlighted
Absent Member.
Absent Member.

Re: Capturing high/low values of an array with Loadrunner

What do you mean by high/low values? It would be great if you could explain with an example.
0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Capturing high/low values of an array with Loadrunner

So I grab an array of values using web_reg_save_param. Within that array are integers. I need to output the highest and lowest integer values from that array to a file. Is there a simple way to isolate just those values and output them?
0 Likes
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: Capturing high/low values of an array with Loadrunner

There is no built-in mechanism. You can traverse through all the values and verify it on your own conditions.
0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Capturing high/low values of an array with Loadrunner

Maybe this is a better question. Is there an easy way to order or sort array values from highest to lowest? If so, how would one go about doing it?
0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Capturing high/low values of an array with Loadrunner

Use below piece of code in any header file or create a new headerfile and include it in your code. Refer to global.h (in any existing script) to see pattern.

// selection sort used to sort an array of integers into ascending order
void selectionSort ( int arr[], int size )
{
int indexOfMin;
int pass;
int j;

for ( pass = 0; pass < size - 1; pass++ )
{
indexOfMin = pass;

for ( j = pass + 1; j < size; j++ )
if ( arr[j] < arr[pass] )
indexOfMin = j;

swap ( arr[pass], arr[indexOfMin] );
}
}

// swap function for integers
void swap ( int& x, int& y )
{
int temp;
temp = x;
x = y;
y = temp;
}


----------------------------------------------------------------
If my answer helped, rate it.

Regards,
Kamran Khan
www.kamran-khan.net
----------------------------------------------------------------

Sincerely,
Kamran Khan
Principal/Lead, SQA & Test Automation, Certified HP PC, LR, QTP & CCNA

Web:
www.chrometechnologies.org
www.chromeinstitute.com
www.chromehosting.net
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.