Highlighted
Absent Member.
Absent Member.
1433 views

Run Logic Block Percentage

Hi, i am using Loadrunner 9.10 and im having a problem with telling it what i need it to do.

i have three sets of actions in blocks in the run logic and i need them to all run at different percentages at a time. (block0 to run 45% of the time block1 25% and block2 at 30%)

i changed the properties of each block to what i thought was right, by setting the run logic to "Random" and the iterations to whatever % i needed them to run at, but doing this only makes the blocks run the number of times i put in the iteration field.

please look at the SS to see what properties i have given a block

any help would be amazing
0 Likes
2 Replies
Highlighted
Absent Member.
Absent Member.

Re: Run Logic Block Percentage

Try this:

srand(time(NULL));

rNum= rand() % 100;

lr_output_message("rNum is %d", rNum);

// Login 100% of the time
Action();

if (rNum<=45)
{
Do this;

}

if (rNum<=25)
{
Do this;
}

if (rNum<=30) { Do this;}
0 Likes
Highlighted
Absent Member.
Absent Member.

Re: Run Logic Block Percentage

Another option would be to right click on "Run" go to properties and change that from "sequential" to "random", then set your percentages on the blocks as you have done prior.

Thanks,
Jacqui
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.