Absent Member.
Absent Member.

How to specify number of iterations while running Vugen script through command line

Hi Team,

My requirement is to run vugen script with specified number of iterations through command line.

I have tried below. Please provide your suggestions on this

1. mdrv.exe -usr "path of usr file" -loop "2" -- This command not iterating the scirpt 2 times.

2. mdrv.exe -usr "path of usr file" -threads "2" -- This command is iterating two times. My problem is for 2 iterations

same value is being passed.It is not taking different value.

 I have created parameter with two values  with the specified option "change value for each iteration".

3. I have also tried running below command flollowing below steps:

mdrv.exe -usr "path of usr file" -iter "no_of_iters"

In VuGen, select Run-Time Settings -> Additional attributes.
2. Create an argument name (for example, "iter"), and give a default argument value of 2.
3. Use a for loop in the Action item, and repeat the action "iter" number of times.


int iterations, i;
iterations = atoi(lr_get_attrib_string("iter"));

for (i = 1; i <= iterations; i++)
// action recorded
lr_output_message("This is a test, iteration is %s", lr_get_attrib_string("iter"));
return 0;

In this also same parameter value is passing for every iteration.

Please guide me what needs to be done to pass different value for each iteration.



2 Replies
Acclaimed Contributor.
Acclaimed Contributor.

Re: How to specify number of iterations while running Vugen script through command line


I have not worked that much with commandlin arguments, so there I can't help you. But I think the first one should work, have you tried without qoutes?  mdrv.exe -usr "path of usr file" -loop 2

But if you do a loop as above, you are not actually doing iterations, but you can manually  change/advance the parammeter by


last thing in the loop. If you have multiple parameters, they should be of type "Same line as ParamName" and you need to advance one of them.

br /ola

Please mark post as solved if your problems or questions is/are resolved.
If this post was valuable to you, please consider kudo it.


New Member.

Re: How to specify number of iterations while running Vugen script through command line

I had a similar requirement and thanks to your post, I tried with "loop" & "iter" commands, which did not work. The iteration value did not increase nor did the parameter value get updated.

The following combination did work:

  • Use -threads "number of iterations" for command 
  • Add lr_advance_param(<parameter name>) before return line in Action

The output will be generated in 2 different output.txt files, having same name but incremented by 1 (eg: output.txt (1st iteration) & output1.txt (2nd iteration) for iterations=2)


Kindly update here if it helps.

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.