Wednesday, April 29, 2009

Error: "Vuser failed to initialize extension vbascriptext.dll" when replaying a VB or COM script

The user receives the following error while replaying a VB or DCOM script:

"Vuser failed to initialize extension vbascriptext.dll."

Solution

 Troubleshooting vbascriptext.dll error

1. Make sure that VBA is installed properly :
    a. Install the VBA drivers by going to Start -> Programs -> LoadRunner -> Tools -> VBA Setup.
    b. Complete the install and reboot the machine.
    c. Run your script again.

    Note: If you are using older versions of LoadRunner ( before LoadRunner7.5) please contact Customer Support for the VBA setup install.
2. VBA compiler has a limitation of up to 39 characters of the file name. Since Mercury adds additional characters to the script name, it must be 21 characters or less.

3. If the problem persist, try to run your script though the VBA IDE once. To do so:
    a. Bring up your script in VuGen.
    b. Go to Vuser -> Run-time settings -> VBA.
    c. Enable "Debug script through VBA IDE (VuGen only)."
    d. When you run the script, VB IDE should be launched. If not, it means VBA driver was not installed (properly). You might need to reinstall your VBA setup.

4. If step (3) brings you to the line 'Dim objectHelper As New LoadRunnerVbs.ObjectFactory', it is an indication that LoadRunner helper object is not registered. You can manually register lrapihlpr.dll and lrapivbs.dll under the \bin directory. After that, "LoadRunner Protocol Replay Helper" will be checked by default in the Run-Time Settings -> VBA option.

5. Make sure that you are using the VB function correctly. For example, LoadRunner function should be referenced as 'lr.' instead of 'lr_'
    Example: lr.save_string "param_value", "param_name"

6.Check the security-properties of the \bin\vba6_setup\vba6.msi file and make sure 'Everyone' have full permissions on it. Uninstall the VB Addin by right-clicking on vba6.msi file and selecting 'uninstall' and re-install the Add-in.

Note:
1. You might need to reboot your machine after making these changes.
2. For running script on a remote machine, please make sure that you installed the components for the application on all load generator machines.  

Tuesday, March 24, 2009

Monitoring Weblogic using LR

Check in the controller available graphs for Weblogic (JMX) type. If it is not present then do the customization to display it:

1. edit the file (open with a wordpad)
"HP\LoadRunner\dat\onilne_graphs\online_resource_graphs.rmd"

2. Look for [WebLogicJMX]

3. Change: EnableInUi=1


Then do the following steps to access the monitors:

a) Download weblogic.jar from server and put it in \classes

b) Remove jmxri.jar from \classes (keep a backup somewhere)

c) Install Java on controller and update the \dat\monitors\WebLogicMon.ini to point to installed java

JVM="C:\Program Files\Java\j2re1.4.2_18\bin\javaw.exe"

JavaVersion=1.4.2_18


Then restart your controller and add the measurements to your weblogic graph.

If you are not able to add the machine and getting a host can't be found error, then do the following steps:

********************************************************

Make sure that the host name and IP can be resolved:

From Command Prompt (Start -> Run -> type in cmd.exe):
1. ping with the machine name and take down the returned IP address.
Example: ping
2. ping with the IP address returned from (a) with -a option.
Example: ping -a 111.111.111.111.

If you have problem on getting the expected information, things you can try includes:

1. Update the host file.
You can try to add the name and the IP address of the WebLogic Server host machine into the hosts file
a. Go to c:\winnt\system32\drivers\etc\
b. Edit hosts in word editor
c. Add the hostname and IP address to the last line.
Example:
127.0.0.1 localhost


After the above changes, try to add the WebLogic monitor again. Please note that you may need to kill the javaw.exe process before adding the monitor. To do so
1. Bring up the Task Manager ( Cntrl-Alt-Delete -> Task manager )
2. Switch to the 'Process' tab.
3. Search for javaw.exe and end the process.

********************************************************

Note: Please note that Weblogic (JMX) monitoring can only be used till weblogic version 9.X. For higher version you need to install sitescope and get the data.

Friday, March 13, 2009

How to convert a C-Web Vuser script to a Java Vuser script

Converting a C Vuser to a Java Vuser requires sed.exe and lrconvertweb.sed

For LoadRunner 8.0 and above
1. Record your Web Vuser using standard HTML/HTTP recording.

    Note:
    a. Be aware that Java Vusers use different parameter braces; Web uses "{ }" and Java Vusers use "<>," which can cause some problems with converted users. Edit the script or the options appropriately.
    b. Make sure that the Java environment is setup properly by running an empty Java Script first.
2. Replay your Web Vuser. When it replays correctly, cut and paste the entire script into a text document.
    Example:
    C:\temp\web.txt

    Note: There is a known limitation on the number of lines the sed utility can process. If you have a large file, break down the script to smaller chucks, with 1000 lines each. Then, convert each of the segments to Java

3. Make sure that \bin is in your system's PATH enviroment. Then open command line and switch to \dat directory. Enter the following command:
    sed -f web_to_java.sed [script_file] > [destination]

    Example:
    sed -f web_to_java.sed c:\temp\web.txt > c:\temp\java.txt

4. Open the C:\temp\java.txt file, and copy the entire contents into your Java Vuser's Action section when it is appropriate for your application. If you are placing the generated Web Java script into a Java-Template user, you will need to Modify the public int action() line to look like public int action() throws Throwable, otherwise the user may not run. Recorded Java users (i.e., RMI/Corba) should already have this change.

5. You should now be able to parameterize the script and use it to correlate with the combined Java Vuser.

6. After converting the script to Java, you may need to set some Web related Run-Time Setting. Since 'Internet Protocol' section is missing in Java-Related template, you can do the following to add the Run-Time Settings:
a. Close VuGen
b. Navigate to the c. Edit the relavant .lrp (General-Java.lrp for Java template) file using a word editor.
d. Locate the [Vugen] section.
e. For the data for CFG_TAB_DLL=, add a comma (,) and add LRWRunTimeSettingsUI.dll to it.


Thursday, March 12, 2009

Error: "failed to create agent channel " during Citrix recording with Citrix

During Citrix Recording or Replay with Citrix Client 10, the user encounters the following error: "failed to create agent channel".

Solution:

Open a notepad and copy paste the following entries to it:

**********************

Windows Registry Editor Version 5.00


[HKEY_LOCAL_MACHINE\SOFTWARE\Citrix\ICA Client\Engine\Lockdown Profiles\All Regions\Lockdown\Virtual Channels\Third Party\CustomVC]

"VirtualChannels"=""

[HKEY_CURRENT_USER\SOFTWARE\Citrix\ICA Client\Engine\Lockdown Profiles\All Regions\Lockdown\Virtual Channels\Third Party\CustomVC]

"VirtualChannels"=""

************************************

save the notepad on desktop as a .reg file (like "citrix.reg")
Then close the notepad and go to desktop and double-click the file you saved.
It will add the entry to your registry. After that re-login to your windows session and record the application again.
You will be able to record now...

How to monitor Unix resources from controller

There is no need for any LoadRunner installation to be on a Unix/Linux Machine to be monitored.
However, the machine must have the default RSTAT daemon installed and running. The controller establishes a UDP socket connection with the UNIX machine. It first communicates with port 111 on the Unix machine and this port is then mapped to the dynamic port on which the rstatd is working. The controller then queries rstatd and all communication takes place through this established UDP socket connection.

Starting the rstatd process in Unix

To monitor UNIX resources, you must configure the rstatd daemon. Note that the rstatd daemon might already be configured, because when a machine receives an rstatd request, the inetd on that machine activates the rstatd automatically.

To verify whether the rstatd daemon is already configured:
The rup command reports various machine statistics, including rstatd configuration. Run the following command to view the machine statistics:
>rup host
A remote host will only respond if it is running the rstatd daemon. If you do not receive a response, or if you receive an error message, the rstatd daemon is not configured.

To configure the rstatd daemon:
1 Run the command: su root
2 Go to /etc/inetd.conf and look for the rstatd row (it begins with the word rstatd). If it is commented out (with a #), remove the comment directive, and save the file.
3 From the command line, run:
> kill -1 inet_pid
where inet_pid is the pid of the inetd process. This instructs the inetd to rescan the /etc/inetd.conf file and register all daemons which are uncommented, including the rstatd daemon. 4 Run rup again.
If the command still does not indicate that the rstatd daemon is configured, contact your system administrator.

Which port is rstatd daemon running on:
You can run a UNIX utility called rpcinfo and identify the rstatd's port number. By running
> rpcinfo -p
you will receive a list of all RPC servers registered in the host's portmapper, along with the port number. This

Wednesday, March 11, 2009

Working with Firewalls in Loadrunner

Working with a firewall means that you can prevent unauthorized access to
or from a private network, on specific port numbers.

In a regular LoadRunner load test scenario (not over a firewall), the
Controller has direct access to the LoadRunner agents running on remote
machines. This enables the Controller to connect directly to those
machines.

When running Vusers or monitoring applications over a firewall, this direct
connection is blocked by the firewall. The connection cannot be established
by the Controller, because it does not have permissions to open the firewall.

LoadRunner solves this problem by using a communication configuration
based on HTTPS or secured TCP/IP. This configuration uses the standard SSL
port on the firewall (port 443).

A LoadRunner agent is installed on load generators running Vusers over a
firewall, and on Monitor Over Firewall machines that monitor the servers
that are located over a firewall. The agent communicates with the MI
Listener machine through port 443 in the firewall.

The MI Listener is a component that serves as router between the Controller
and the LoadRunner agent.

When the LoadRunner agent connects to the MI Listener, the MI Listener
keeps a listing of the connection to the agent using a symbolic name that
the agent passed to it.
When the Controller connects to the MI Listener, it communicates to the
MI Listener through port 50500.

The following diagram is a basic example of a LoadRunner deployment over
a firewall.



Setting Up your System to Use Firewalls: Basic Steps

Setting up your system to use firewalls involves the following stages of
configuration:

Installation and initial configuration
Running Vusers over a firewall

****************************************
Installation and initial configuration
****************************************

To enable over-firewall communication, ensure that you have installed the
following LoadRunner components:

MI Listener
Monitor Over Firewall component
To perform initial configuration of your over-firewall system:
1 Configure your system according to TCP or HTTPS.
2 Modify your firewall settings to enable communication between the
machines on either side of the firewall.
3 Configure the MI Listener.

Configuring the MI Listener

To configure the MI Listener:

1 Open incoming HTTPS service for port 443. The port settings are set by your
system administrator.
2 Stop the LoadRunner agent on the MI Listener machine by right-clicking its
icon in the system tray and selecting Close from the popup menu.
3 Run MI Listener Configuration from
Start > Programs > LoadRunner > Advanced Settings, or run \launch_service\bin\MILsnConfig.exe.



4 Set each option as described in the following table:


5 Click OK to save your changes, Cancel to cancel them, or Use Defaults.
6 Restart the LoadRunner agent by double-clicking the shortcut on the
desktop, or choosing Start > Programs > LoadRunner.
7 Make sure that port 443 is free on the MI Listener machine.

**********************************
Running Vusers over a firewall
**********************************

To set up your system to run Vusers over a firewall:

1 On each load generator machine that will be running over a firewall,
configure the LoadRunner agent to communicate with the MI Listener.
2 Configure the Controller machine to recognize the load generator and MI
Listener machines.

Configuring LoadRunner Agents Over the Firewall

1 Stop the LoadRunner agent by right-clicking its icon in the system tray and
selecting Close.
2 Run Agent Configuration from Start > Programs > LoadRunner > Advanced
Settings, or run \launch_service\bin\AgentConfig.exe.
3 Select the Enable Firewall Agent check box, and then click Settings.



The Agent Configuration dialog box opens.



4 Set each option as described in “Agent Configuration Settings”




5 Click OK to save your changes, or Cancel to cancel them.
6 Restart the LoadRunner agent by double-clicking the shortcut on the
desktop, or select Start > Programs > LoadRunner > LoadRunner Agent
Service/Process.
7 Check the connection status between the LoadRunner agent and the MI
Listener.

Configuring the Controller for Running over a Firewall

1 Run the Controller from
Start > Programs > LoadRunner > Applications > Controller and create a
new scenario, or load an existing one.
2 Click Generators to display the Load Generators window. In the Name field,
enter the symbolic name of the server. This is the same name that you
entered in the Local Machine Key setting in the Agent Configuration.




3 Select the Load Generator, and click Details to display the Load Generator
Information.




4 In the Security tab, enter the MI Listener machine's name in the MI Listener
field. This is the same name that you entered in the MI Listener Name
setting of the Agent Configuration dialog box. In this example, the MI
Listener is bunji.
5 In the Firewall Settings section, select one of the following options:
➤ Enable running Vusers over Firewall. To run Vusers over the firewall.
➤ Enable Monitoring over Firewall. To monitor Vusers over the firewall.
6 Click OK to return to the Load Generators dialog box.
7 Select the load generator and click Connect.

This will do all the setup required to run your test over the firewall...

How to replay Citrix script against a different window size

Go to the script directory in Windows Explorer.

Open the default.cfg file located inside the script directory and change the window= value under the [CITRIX] section to a valid value that can be seen in the recording options (640 x 480, 800 x 600, 1024 x 768,1280 x 1024 and 1600 x 1200).

Please note that if you have any ctrx_sync_on_bitmap functions recorded it will not replay in the new window setting because the hash value will be different.