Tag Archives: HP LR 11

Use rdp_sync_on_window for a partially changing window title

To use rdp_sync_on_window for a partially changing window title for the following scenario

rdp_sync_on_window(“StepDescription=Window Synchronization 1”,

“Snapshot=snapshot_12.inf”,

“WindowTitle=I am static XXXX YYYYY ZZZZ”,

“WindowState=ACTIVE”,

RDP_LAST);

Need to use sync on the portion of the window name that doesn’t change where XXXX YYYYY ZZZZ change, but the first part (I am static) stays the same.

To achieve this the windowTitle argument comes with regular expression

WindowTitle/RE=

In the above example, we can keep the first part static(I am static) and exclude the 2nd part (XXXX YYYYY ZZZZ)using Regular expression.

Advertisements

LR Controller throws Microsoft Visual C++ Runtime Library Runtime Error

Using LoadRunner (LR) 11.00 Patch 4 on a machine that was previously running LR 11.50. When trying to open a scenario the wlrun process crashes and the following message is displayed:

Unsupported operation was attempted

Microsoft Visual C++ Runtime Library

Runtime Error!

Program: C:\\Software\\HP\\LoadRunner\\bin\\wlrun.exe

abnormal program termination

This happens on every attempt to open an LR scenario. Uninstalling and re-installing LoadRunner 11.00 or and 11.04 patches does not resolve the problem. Upgrading LoadRunner to version 11.50 is not possible on this machine as it currently has to run with an LR 11.00 license key.

In certain cases uninstalling of LR 11.50 may leave registry keys enabled for the LR 11.50 version that are incompatible with LR 11.00 and therefore cause the 11.00 wlrun process to crash. To resolve the problem try the following steps on a Windows 7 64 bit machine:

Back up the registry.

Run Regit and go to HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{6B2455C3-CAF8-4578-BBA4-B7566F89EBAA}\InprocServer32

Delete any 11.5x subfolders.

On a Windows XP 32 bit machine the invalid 11.5x entry will be found in

HKEY_CLASSES_ROOT\CLSID\{6B2455C3-CAF8-4578-BBA4-B7566F89EBAA}\InprocServer32\11.5x.0.0

Error: “Object doesn’t support property or method ‘indexOf'” when saving the “Speed simulation” run-time settings of a TruClient script

An error is received when trying to save the “Speed simulation” Run-time settings of a TruClient script:

“Script Error: An error has occurred in the script on this page.

Error: Object doesn’t support property or method ‘indexOf'”

As a result the settings are not saved and the “Save” button becomes disabled.

The issues is caused by missing default values for the speed simulation settings.

To fix the issue for the current script:

1.Open the default.cfg file in the script folder.

2. Go to the [ModemSpeed] section

3. Add values for the ModemSpeedUpload, ModemSpeedDownload and ModemSpeedDownloadAndUpload settings.

For instance:

[ModemSpeed]

ModemSpeedMode=1

ModemSpeedUpload=0

ModemSpeedDownload=0

ModemSpeedDownloadAndUpload=0

4. Save the file and reopen the script in TruClient

5. Go to the Run-time settings > Network > Speed simulation. Changing and saving the values should work now.

To fix the issue for any new scripts, modify the run-time settings templates for TruClient IE and Firefox:

Apply the above changes to the following default.cfg file:

<LoadRunner installation>\template\WebIE\default.cfg

<LoadRunner installation>\template\Web2UI\default.cfg

After saving the changes, any new TruClient script will have the default runtime settings for “Speed simulation”

VuGen is unable to save imported Libraries in TruClient

When importing a Library from Develop Script -> Function Libraries and saving it, everything is fine. But when closing the Develop Script mode and opening it again, the library is not shown.
The script is not able to parse the XML files correctly. It could be due to crash of VuGen before the script became corrupted or if the script replay is interrupted unexpectedly. If something unexpected happened, VuGen can get corrupted and the reading process may be incorrect.
The following can help to fix the issue:
1. Take the .xml files from the “libraries” folder (within the script folder) and put them out of the script folder.

2. Delete the original files from the “libraries” folder.

3. Open the script with VuGen.

4. Go to Function Libraries.

5. Select the button “Import Library”.

6. Navigate and select the .xml files saved out of the script folder.

After doing this, the script will read/parse the XML files again and this time, it will be done correctly.

Parameterization and Correlation in JOH (Java Over HTTP) protocol scripts

Parameterization and Correlation in JOH (Java Over HTTP) protocol scripts

The following details how to parameterize and capture dynamic data in a JOH script.

Parameterization

In the following example we have recorded a JOH script that adds an email address to a SiteScope server Email Preferences. The first thing to do is find the request to the server that contains the email address that we added. Note: probably the easiest way to do this is search the server request xml files in the script folder.

Once the relevant request has been found expand out the xml file from inside vugen. In the map argument you can see the fields with the email address and name that we added when recording the script:

To parameterize the _email and _name we need to replace the values in the object with our parameterized values. There are basically 2 approaches to doing this:

1) Use the objects normal public methods (i.e. get/set methods)

2) Use the reflection API wrapper provided by LoadRunner (lr2.fieldGetter and lr2.fieldSetter)

Approach 1) is normally the preferred way to do this but will normally need either good knowledge of the application classes or the relevant class files decompiling. Using this approach we can add the following code to set the _name and _email in the object. The added code is in blue font

////////////////////// requestBody37.xml //////////////////////

InvocationInfo InvocationInfo_create37 = (InvocationInfo) JavaHTTP.readObject(InvocationInfoBA37);

Map createDetails=(Map)InvocationInfo_create37.getArgs()[1];

createDetails.put("_name","Test Email");

createDetails.put("_email", "testemail");

……………….

Finally we replace “Test Email” and “testemail” with parameters:

////////////////////// requestBody37.xml //////////////////////

InvocationInfo InvocationInfo_create37 = (InvocationInfo) JavaHTTP.readObject(InvocationInfoBA37);

Map createDetails=(Map)InvocationInfo_create37.getArgs()[1];

createDetails.put("_name","<NameParam>");

createDetails.put("_email", "<EmailParam>");

………………

Approach 2). The other way to set data fields in objects is with the replection API wrapper provided by LoadRunner – specifically the lr2.fieldGetter and lr2.fieldSetter methods. These allow the manipulation of an object’s private data. The usage of these methods is documented in the Function Reference documentation. The following is the same example as above but using lr2.fieldGetter and lr2.fieldSetter:

////////////////////// requestBody37.xml //////////////////////

InvocationInfo InvocationInfo_create37 = (InvocationInfo) JavaHTTP.readObject(InvocationInfoBA37);

Map myMap = (Map)lr2.fieldGetter(InvocationInfo_create37, "args[1]");

myMap.put("_name", "<NameParam>");

myMap.put("_email", "<EmailParam>");

lr2.fieldSetter(InvocationInfo_create37, "args[1]", myMap);

………………..

Correlation

The same approach is used when it is necessary to perform correlation of a dynamic data. The difference is that the dynamic value first needs to be captured from the server response.

In the following example we want to capture the http port returned from Current User ID returned from the server. The ID is in the responseBody1.xml :

Again we can expand out the xml:

And use either Approach 1) or Approach 2) above to capture the data:

Using Approach 1)

////////////////////// requestBody1.xml //////////////////////

InvocationInfo InvocationInfo_getApplicationStateObject1 = (InvocationInfo) JavaHTTP.readObject(InvocationInfoBA1);

InvocationResult InvocationResult_ApplicationStateObject1 = (InvocationResult) JavaHTTP.sendSerialized(InvocationInfo_getApplicationStateObject1, 1,

"ObjectsDeserializerDefaultImpl",

"remoteProxy_2",

"URL=http://16.26.85.150:8080/SiteScope/remoteProxy",

new String[]{

"Method=POST",

"Resource=0",

"RecContentType=application/remoteclientresponse",

"Referer=",

"Mode=HTML",

"EncType=application/octet-stream",

LAST});// 1 is the number of the header file, record time response is at file responseBody1.xml

ApplicationStateObject applicationState = (ApplicationStateObject) InvocationResult_ApplicationStateObject1.getResult();

String currentUserId = applicationState.getCurrentUserId();

………………..

Using Approach 2)

////////////////////// requestBody1.xml //////////////////////

InvocationInfo InvocationInfo_getApplicationStateObject1 = (InvocationInfo) JavaHTTP.readObject(InvocationInfoBA1);

InvocationResult InvocationResult_ApplicationStateObject1 = (InvocationResult)

JavaHTTP.sendSerialized(InvocationInfo_getApplicationStateObject1, 1,

"ObjectsDeserializerDefaultImpl",

"remoteProxy_2",

"URL=http://16.26.85.150:8080/SiteScope/remoteProxy",

new String[]{

"Method=POST",

"Resource=0",

"RecContentType=application/remoteclientresponse",

"Referer=",

"Mode=HTML",

"EncType=application/octet-stream",

LAST});// 1 is the number of the header file, record time response is at file responseBody1.xml

String currentUserId = (String)lr2.fieldGetter(InvocationResult_ApplicationStateObject1, "result.currentUserId");

………………..

The saved data can now be written in a subsequent request body object in the same way as our parameterized values were – i.e. either using the objects normal public methods or using lr2.fieldGetter/lr2.fieldSetter.

Capture a process memory dump with the Microsoft Technet procdump tool

Processes can sometimes terminate unexpectedly, i.e. "crash", often due to an unhandled exception being encountered during execution. There are several methods and tools available to enable capturing a memory dump of such a crash to help determine the root cause. One of these tools is a standalone tool called procdump. It is a simple, reliable and flexible way to capture a crashdump, and common uses of the tool are explained in this document.

The standalone tool procdump is part of the sysinternalssuite package of tools which can currently be downloaded from here:

http://technet.microsoft.com/en-gb/sysinternals/bb842062.aspx

The tool is run from the command line and various options are available. Some common uses follow:

Example 1. In this example procdump is attached to a running process which is expected to crash with an unhandled exception. When the process encounters the exception a full dump is created in the C:\Dumps folder:

c:\MyData\Tools\SysinternalsSuite>procdump -e -ma mdrv.exe C:\Dumps

ProcDump v6.00 – Writes process dump files

Copyright (C) 2009-2013 Mark Russinovich

Sysinternals – http://www.sysinternals.com

With contributions from Andrew Richards

Process: mdrv.exe (11372)

CPU threshold: n/a

Performance counter: n/a

Commit threshold: n/a

Threshold seconds: n/a

Number of dumps: 1

Hung window check: Disabled

Exception monitor: Unhandled

Exception filter: *

Terminate monitor: Disabled

Dump file: C:\Dumps\mdrv_YYMMDD_HHMMSS.dmp

Press Ctrl-C to end monitoring without terminating the process.

[13:43:01] Exception: C0000005.ACCESS_VIOLATION

[13:43:01] Unhandled: C0000005.ACCESS_VIOLATION

Unhandled Exception.

Writing dump file C:\Dumps\mdrv_140320_134301.dmp …

Writing 91MB. Estimated time (less than) 3 seconds.

Dump written.

The process has exited.

Example 2. In this example procdump waits for the specified process to run (in this example mdrv.exe) then attaches to the process. When the process encounters an unhandled exception a full dump is created in the C:\Dumps folder:

c:\MyData\Tools\SysinternalsSuite>procdump -e -ma -w mdrv.exe C:\Dumps

ProcDump v6.00 – Writes process dump files

Copyright (C) 2009-2013 Mark Russinovich

Sysinternals – http://www.sysinternals.com

With contributions from Andrew Richards

Waiting for process named mdrv.exe…

Process: mdrv.exe (10452)

CPU threshold: n/a

Performance counter: n/a

Commit threshold: n/a

Threshold seconds: n/a

Number of dumps: 1

Hung window check: Disabled

Exception monitor: Unhandled

Exception filter: *

Terminate monitor: Disabled

Dump file: C:\Dumps\mdrv_YYMMDD_HHMMSS.dmp

Press Ctrl-C to end monitoring without terminating the process.

[13:44:33] Exception: C0000005.ACCESS_VIOLATION

[13:44:33] Unhandled: C0000005.ACCESS_VIOLATION

Unhandled Exception.

Writing dump file C:\Dumps\mdrv_140320_134433.dmp …

Writing 91MB. Estimated time (less than) 3 seconds.

Dump written.

The process has exited.

Example 3. Sometimes attaching procdump to a process can prevent the exception and subsequent crash from actually happening. In these rare cases it may be possible to catch the exception and create a dump by configuring procdump as the Just-in-Time debugger.

Note! The following use of procdump will modify the registry AeDebug key (in multiple places in 64-Bit Operating Systems). You should take a note of the original Keys and Values of the following key on a 32-bit System before proceeding:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug

And additionally on a 64-bit System:

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\AeDebug

c:\MyData\Tools\SysinternalsSuite>procdump -ma -i C:\dumps

ProcDump v6.00 – Writes process dump files

Copyright (C) 2009-2013 Mark Russinovich

Sysinternals – http://www.sysinternals.com

With contributions from Andrew Richards

Set:

HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug

(REG_SZ) Auto = 1

(REG_SZ) Debugger = "c:\MyData\Tools\SysinternalsSuite\procdump.exe" -ma -j "C:\dumps" %ld %ld %p

ProcDump is now set as the Just-in-time (AeDebug) debugger.

Java Record/Replay Vusers running out of heap memory during long duration load test

Java Record/Replay Vusers are running out of heap memory during long duration load test, for example when running a load test with 1000 Vusers for 5 days.

Please try the following suggestions :

1) In additional parameters use -Xmx512M -Xms512M

2) I have split the JVMs to 25 max threads per process.

For this, use MaxThreadPerProcess in the VuGen section of the *.lrp (corresponding to the protocol used) in <LoadRunner>\dat\protocols folder.

3) Disable Data Execution Prevention (DEP), User Account Control (UAC) , Windows Firewall and hyperthreading.

4) Looking at the results folder in this particular case, noticed that there are about 1000 Vuser logs and each of size 4 MB to 14 MB.

Most of them have the following 2 lines repeated and nothing else.

System.out: Starting LoadRunner Test Notify: [MsgId: MMSG-17999]

System.out: Ending LoadRunner Test Notify: [MsgId: MMSG-17999]

It looks like every iteration has these 2 lines and it is just causing a lot of I/O.

My suggestion is to remove the System.out.println from the script so that unnecessary I/O will be eliminated.

If print is needed, then instead do logging with "Send a message only when error occurs" and then enable extended logging. This way, logging will be done only when an error occurs we will have all the details for debugging.