Highlighted
Trusted Contributor.
Trusted Contributor.
873 views

How to find the total number of records in a parameter dat file?

Jump to solution

I know that for regular purposes loadrunner handles iterating through the parameter file and fetch records. Here is my problem - 

I have a script (Script1) that is purely data setup, I run this script for about 10 to 15 mins before I start my test which has another script(Script 2) that uses the data created by the previous mentioned script.

The data that is being generated can be used only once by Script2. Now to be more elaborate -

Script1 - Is actually 3 different scripts producing 3 files with data?

Script2 - Is only 1 script, but I have 3 different functions that use the 3 data files created in Script 1.

I am currently using unique values and aborting the user when the parameter files are exhausted. But I find that all the data in each of the parameter files are not exhausted before the user failure. This is because during a particular test there is a chance that one of the functions get executed more number of times and it consumes the data in the parameters sooner.

 

I want to add a logic to the script based on the remaining number of rows in the dat files to choose the function appropriately. Such that eventually if the user does fail, all the data in the parameter files have already been used.

 

I cannot increase the number of vusers by splitting the functions to 3 scripts as there are only a certain amount of sessions allowed in the test.

0 Likes
1 Solution

Accepted Solutions
Highlighted
Trusted Contributor.
Trusted Contributor.

Re: How to find the total number of records in a parameter dat file?

Jump to solution

Thanks @JHF Remmelzwaal & @orenga for your reply.

I did try your approach, however did not work. Below is what I think might have been the issue -

* I have a script with 3 parameters that I use and each of them is being used in a particular path of execution in random. So not all parameters are used in every iteration.

* Somehow loadrunner picks values based on the iteration number and do not have a way of picking values based on the usage from the list. This causes the script to fail with data not available in parameter quickly.

 

I currently have solved it by managing the parameter substitution with in the script using arrays. I  read from the parameters and write everything in to an array and am using the values from the array in the script instead of the parameter file. This way i have more control over what is being used in the script.

This definitely is not the best way to resolve the problem as there would be issues when multiple users are required to run the script. In my case i just need one user to go through this.

I found this thread discussing more about the possibilities of having a way to fetch unique values - https://groups.google.com/forum/#!msg/lr-loadrunner/PMukm37t25Q/aeJAHskrAQAJ

 

I am wondering why loadrunner have not addressed this issue for so long. The thread above is quite old, some 2 years ago.

View solution in original post

0 Likes
4 Replies
Highlighted
Honored Contributor.
Honored Contributor.

Re: How to find the total number of records in a parameter dat file?

Jump to solution

Hi

It’s little complicate because the mdrv got range of parameters value per vuser when the replay start .

I’m not sure that there is an api to get the remains parameters at file .

What I have in mind that could help :

  • Maybe adding lr_rendezvous on some point at script could help not to waste all value from file (all vuser should run togheter)

http://hpe-vugen-8dtl-staging.s3-us-west-2.amazonaws.com/en/latest_staging/help/function_reference/Content/FuncRef/c_vuser/lrFr_lr_rendezvous.htm?cshid=lr_rendezvous

  • VTS – server that can send value at run-time and let you know how much value spend .

(I don’t have experiaent with it , maybe  any support guy can help you )

https://admhelp.microfocus.com/lr/en/12.60-12.61/help/WebHelp/Content/VTS/c_start_stop_server.htm

 

Regards

Oren

0 Likes
Highlighted
Acclaimed Contributor.. Acclaimed Contributor..
Acclaimed Contributor..

Re: How to find the total number of records in a parameter dat file?

Jump to solution

Another approach is the following: now you let the script end/abort when any value is exhausted. You might change to return the last value multiple time. You can then in your code compare the previous value with the current value and then take appropriate action.

Signature:
Reward community members who take time to respond and help.
0 Likes
Highlighted
Trusted Contributor.
Trusted Contributor.

Re: How to find the total number of records in a parameter dat file?

Jump to solution

Thanks @JHF Remmelzwaal & @orenga for your reply.

I did try your approach, however did not work. Below is what I think might have been the issue -

* I have a script with 3 parameters that I use and each of them is being used in a particular path of execution in random. So not all parameters are used in every iteration.

* Somehow loadrunner picks values based on the iteration number and do not have a way of picking values based on the usage from the list. This causes the script to fail with data not available in parameter quickly.

 

I currently have solved it by managing the parameter substitution with in the script using arrays. I  read from the parameters and write everything in to an array and am using the values from the array in the script instead of the parameter file. This way i have more control over what is being used in the script.

This definitely is not the best way to resolve the problem as there would be issues when multiple users are required to run the script. In my case i just need one user to go through this.

I found this thread discussing more about the possibilities of having a way to fetch unique values - https://groups.google.com/forum/#!msg/lr-loadrunner/PMukm37t25Q/aeJAHskrAQAJ

 

I am wondering why loadrunner have not addressed this issue for so long. The thread above is quite old, some 2 years ago.

View solution in original post

0 Likes
Highlighted
Honored Contributor.
Honored Contributor.

Re: How to find the total number of records in a parameter dat file?

Jump to solution

Hi

On File + Unique there is an options that use usage and not iteration  :

Select next row : Unique 

Update valuse on : Each Occurrence 

When out of value : Continue with last value 

Regards

Oren

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.