NOTICE: Significant community changes coming soon
The header menu and the home page on our community will be changing soon. Get more information HERE.
Highlighted
Absent Member.
Absent Member.
2786 views

TruClient - Multiply wait time

Hi,

 

We have recently started using truClient, but we have problems when it comes to multiplying wait time (Like the functionality for multiplying think time in http web scripts). The only value we can find is "wait time", but there is no "multiply wait time" setting in runtime settings in Performance Center.

 

We thought about having an external param file and using a value there as base for multiplying think time, but I'm not sure this is very ideal. Is there a "best practice" way to multiply wait-time in truClient scripts ?

0 Likes
8 Replies
Highlighted
Absent Member.. Absent Member..
Absent Member..

I found this useful link from http://www.perftesting.co.uk, hope it helps.

 

End-user behavior is unpredictable and as a performance test engineer, while executing a performance test, our aspiration should always be to reach closest to the real time scenario. Some end users may spend only 2 secs before navigating to next page, while many others may think for more time. Hence in many test scenarios, it would not be ideal to insert a fixed think time value before a web request; rather one must use random think time in such cases. This can be done using advanced javascript functionalities and these are the steps -

 

1) From ‘Toolbox’, copy a wait function and paste it before the web request. 2) In the argument section, replace the interval value ’3′ by ‘Math.floor(11*Math.random()+5);

The above function will return a random number between 5 and 15.

Math.floor() method rounds a number DOWNWARDS to its nearest integer. (Eg. The output of code ’Math.floor(1.8);‘ is 1). Hence 11 is used as a multiplication factor so that an integer in the upper decimals of 10 will be rounded to 10. Math.random() method returns a random number between 0 and 1.

 

Good luck

 

 

0 Likes
Highlighted
Absent Member.
Absent Member.

Why not using Minimum Time feature (described in the User Guide)?

Guy Rosenthal
Network Virtualization PM
0 Likes
Highlighted
Super Contributor.
Super Contributor.

This indicates that I can use the minimum time in the runtime settings to configure a think time.

Is this correct?

 

I surely would like to be able to use this as adding an additional wait step is a pain when scripts become long, it also degrades the readability of the script.

 

It's a pity that the steps minimum time does not support parameterization. I would like to either use a parameter or a javascript variable for this. That does not work in VUgen 11.52 using firefox TruClient.

Will this be possible in future releases?

 

Thank,

Peet

0 Likes
Highlighted
Absent Member.
Absent Member.

Hi Peet,

Thanks for yourfeedback, we'll consider adding this ability in our future releases.

Guy Rosenthal
Network Virtualization PM
0 Likes
Highlighted
Outstanding Contributor.
Outstanding Contributor.

Maybe try something like this?

 

// wait 1-3s
//Math.round( Math.random() * (max - min) + min )
Math.round( Math.random() * (3 - 1) + 1 )

// wait 5-10s
//Math.round( Math.random() * (max - min) + min )
Math.round( Math.random() * (10 - 5) + 5 )

0 Likes
Highlighted
Super Contributor.
Super Contributor.

Hi Guy,

 

But is my first assumption correct? Can I use this as a think time?

And will the transaction response times measured during test then include or exclude this minimum step time?

If it is included, can I filter it out during analysis of the test results?

 

Regards,

Peet

0 Likes
Highlighted
Absent Member.
Absent Member.

Hi Peet,

You may find this article useful regarding your first question and in general:

http://h30499.www3.hp.com/t5/HP-LoadRunner-and-Performance/Times-timing-and-timeouts-in-TruClient/ba-p/6409810

 

This is indeed can be filtered in the analysis as think time.

 

 

Guy Rosenthal
Network Virtualization PM
Highlighted
Contributor.. Contributor..
Contributor..

You can also create a random number parameter then use TC.getParam to populate the wait time value. 

I use the same technique to set static wait values.  This allows me to quickly change wait/think time values in a script.

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.