VUPercentile - a way to have very precise path percentages

Document created by Dave Murphy Employee on Jul 19, 2017Last modified by Dave Murphy Employee on Sep 25, 2017
Version 3Show Document
  • View in full screen mode

For more information about VUPercentile, please refer to here.

 

The example below shows two ways to get different path flows according to percentages using the track property VUPercentile.

 

We are trying to accomplished the below. The attached zipped file contains two ways of doing it: "Compositions for Testing VUPercentile.xml.zip". Both will be explained. The clips contain only delays inside their transactions since both are just examples on how to set up the VUPercentile.

 

S01 - 01 - Homepage

S01 - 02 - Search (12 %)

S01 - 03 - Browse (48 %)

S01 - 04 - Checkout Flow Registered User (28%)

S01 - 05 - Checkout Flow Guest User (12%)

 

Figure 1 shows how the above would be done in LoadRunner if you are familiar with that tool.

 

Figure 1. Run Logic in LoadRunner to accomplish path flow percentages.

 

 

 

Using a Switch to accomplish the percentages.

 

The first way to do it is with the help of a switch. There needs to be a JavaScript at the beginning of the clip to set up the switch cases.

 

var VUPercentile = $sysprop.value("track", "VUPercentile");

// Search (12%)
if (VUPercentile < 12){
    $prop.set("clip", "action", "Search");
}

// Browse (48%)
else if (VUPercentile < 60){      // Search (12%) + Browse (48%) = 60%
    $prop.set("clip", "action", "Browse");
}

// Checkout Flow Registered User (28%)
else if (VUPercentile < 88){   // Search (12%) + Browse (48%) + Checkout Flow Registered User (28%) = 88%
    $prop.set("clip", "action", "Checkout Flow Registered User");
}

// Checkout Flow Guest User (12%)
else {
    $prop.set("clip", "action", "Checkout Flow Guest User");
}

After that just set up the switch as in Figure 2. On each case it can be any container: clip, transaction, group, etc.

 

 

Figure 2. Set up for the Switch with percentages.

Figure 3. Percentage Results after running 10, 000 iterations.

 

Figure 3 shows the results of the clip using the switch for 10, 000 clip iterations. It can be observed that the values are very close to what it was expected.

 

 

 

Using if/then/else to accomplish the percentages.

 

The second way to do it is with the help of a set of if/then/else in the UI, so no need for having a JavaScript. In structure is very similar to the JavaScript for the Switch but everything is in the UI, Figure 4.

 

 

Figure 4. Percentages using if/then/else.

 

Figure 5. Percentage Results after running 10, 000 iterations.

 

Figure 5 shows the result of running 10, 000 iterations using the if/then/else approach in the UI. It can be observed that the values are very close to what it was expected.

 

For setting up the property in the if/then/else, you need to manually enter it with the Property Chooser as shown in Figure 6. Type: System, Starting Element: Current Track and Property Path: VUPercentile.

 

Figure 6. Manually entering a property.

 

 

Important Notes:


- If there is a fast ramp or if the users change rapidly in a certain part of the test, then the percentages will be affected by this and you might get the percentages a little bit off.

- As best practice it is recommended to use renew parallel repeat for running any load test, see the benefits of running with renew parallel repeats here.

Attachments

    Outcomes