Thursday, September 13, 2012

Minimum Permission Level to Install and Run Loadrunner

Problem Statement: What is the minimum access level a user needs to Install and Run Loadrunner and its components ?

Solution: Ideally the user needs to be part of Administrator group on the machines where he wants to install and run loadrunner.

But actually a user needs to be Administrator for installation and power user for running LoadRunner.


It is recommended to be a member of at least power users to run LoadRunner. 
Sometimes, due to security restrictions, this is not possible. In that case, the user must have at least the following rights; these rights needs to be provided appropriately by an Administrator:
1. Full access (read/write permissions) to registry keys as mentioned below:
HKEY_CURRENT_USER\Software\Mercury Interactive
HKEY_LOCAL_MACHINE\Software\Mercury Interactive 
HKEY_LOCAL_MACHINE\Software\Microsoft\Jet\4.0\engines\text
HKEY_LOCAL_MACHINE\Software\Microsoft\Tracing
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\WMI
2. Full access (read/write permissions) to the file system (preferably to the local drive where user account is present and other drive if Loadrunner is installed on a secondary drive) to be able to copy files.

If there is any problem either with agent start up or connection from Controller to the agent on a Windows 2K machine with a power user, then ask the system administrator to perform the following:
1. Open the Local Security Settings window through Start -> Programs -> Administrative Tools -> Local Security Policy.
2. Select Security Settings -> Local Policies -> User Rights Assignments.
3. Add the user to the "Create global objects" policy.

Tuesday, September 11, 2012

Is there a way to suppress errors from perfmon counters in controller

Problem Statement: During our day to day life as performance testers / experts, we must have noticed a lot of errors related to counters during a long running scenario. Mostly the errors are like "A counter with a negative denominator value was detected.", "A counter with a negative time base value was detected." or "A counter with a negative value was detected."

All these errors make the online monitoring a lot difficult to filter out the actual errors coming from the application.

Is there a way to mask these errors related to counters?

SolutionThe answer is Yes, it is possible to do so.
For this you need to do the below change in both Controller and Load Generator machine.


  • Go to the Loadrunner (or performance center host) installation dir; then go to folder "dat -> monitors" 
  • under that folder open the file "nt.cfg" in a wordpad; it will be like as shown in the snapshot below:




  • You can see the "general" section in the file, there is an entry called as "FilterErrors" which has the current value as 6.
  • Now to set the proper value for other errors which you want to suppress, get the Hexa value of the error from MSDN website: " http://msdn.microsoft.com/en-us/library/aa373046(v=VS.85).aspx "
  • Look for the hexa code like " 0x800007D6 (PDH_CALC_NEGATIVE_DENOMINATOR) " for the error " A counter with a negative denominator value was detected. "
  • Open Calculator in scientific mode (in case of XP / win 2003 machine) or programmer mode (in case of win 7 or 2008 server) as shown below


  • Move it to Hex mode and make the entry for the Hex code as it appears for the particular error, in this example it will be "800007D6". Once entered, change the calculator to Dec mode and you will get a number like "2147485654" (see the screenshot below):

  • Copy the value from the calculator and put it in the "nt.cfg" file along with the earlier value separated by comma (,) as shown in the screenshot below:

  • Once done you can perform similar steps for other error types you are getting from windows perfmon counters.
  • Save the "nt.cfg" file and restart the loadrunner agent process (or service) on Load generator.



Monday, September 10, 2012

Functions not allowed while running vusers over firewall

Problem Statement: In certain cases your VUGen script has certain functions (may be custom functions in C like malloc, etc) which runs fine during replay on your machine. But the same function gives an error while running the script on a load generator over firewall (i.e. the vuser is running over a firewall). The error given by LR is: "Error: -19886: CCI security error:You are running under secure mode and the function is not allowed in this mode"

Is there a way to allow the function to be run in the load generator?

PS: This error doesn't come while running the script on a normal load generator (not behind the firewall).


Solution: The answer is Yes, it is possible to do so. 
go to the load generator machine where the above mentioned error is coming; go to the installation directory and open the folder called as "merc_asl".

There will be many "*.asl" files, each corresponding to protocols support during running Vusers over firewall. 

Open the .asl file for the protocol in a wordpad for which you are getting the above error, add your function in that file as shown below:
[Function name]= 
below the [Allowed_Functions] tag


Once you have added the custom function in the asl file; restart the agent service (or process) on the load generator and your script should pass now.

Hope this helps in resolving your issues.

How to create web scripts with different recording option without recording

Problem Statement: In certain cases during recording of a web application we notice that certain actions (or request) are not captured by LR script. Then we are advised to try out in different recording mode and see if we are able to capture the request. 

Is there a way to recreate the script with different recording options without re-recording the business flow again?

Solution: The answer is Yes, it is possible to do so. There is feature in VUGen known as "re generate script" which can be leveraged to get the desired script.

Note: This action will reset all customization done on the saved script (like custom formatting, checks, transaction naming etc)

In this solution which i tried out, i had recorded the application (AUT) in web click and script in a multi-protocol mode. Following the below steps, i had converted the "web click and script" to normal web HTML script.
Once the script is generated, you need to save the script locally and then click on Tools Menu on Vugen and select Regenerate script:



Once you click that option, you will notice a small window with warning message, click on the options button:



After clicking the options menu, you will get the recording option window; select the appropriate recording mode / options you want the script to be generated with and click on OK:


Click on OK on the previous window after the recording option window closes and you can see the VUGen code being re-generated:

Save the script once the code generation is complete.