QuickTest Professional hangs opening its User Interface dialogs (Open, Save, etc) using Remote Desktop (RDP)

An End-user uses QuickTest Professional (QTP) both physically (in front of machine) and remotely via Remote Desktop (RDP).

When trying working physically everything works fine, however when trying to perform any of the following actions, QTP appears to hang:

Open an already created test:

Going to File menu, access “Open” option and select “Test”

On main screen, click on “Open” button

Using keyboard combination CTRL + O (ctrl-0, ctrl+o, etc)

Save a newly created test:

Going to File menu, click on “Save” or “Save As” option

On main screen, click on “Save” button

Using keyboard combination CTRL + S (ctrl-s, ctrl+s, etc)

Note: other tools such as the QTP Script Editor gets affected by this

End-user can open test when such are listed under recently opened items of the “File” menu.

The common factor of these options is that such require dialogs which worked fine when last accessed on a non-remote session.

QuickTest Professional provides a set of configuration files and registry entries per Windows user profile which utilize the tool, such as last location of a dialog however when same windows user logs in to same machine regardless of method (physical or remotely), settings from the last session are saved/stored on the configuration files/registries for that user.

The last location of the dialogs of the options used (Open and Save dialogs as indicated on example scenario) are configured for the session which last used either of them, therefore if for example the machine was used physically with higher resolution or even multiple monitors, another session such as a remote one, would be affected and still try to locate the dialogs on same coordinates, even if it is visually outside of the current display.

Modify location

After QTP appears to hang, use keyboard combination: ALT + Spacebar

Once a context/pop-up menu shows up, select “Move” option

(Important) Use the arrow keys (Up, down, left or/and right)

Now your mouse should gain control over the window/dialog to “move”

Move window to desired location

Reestablish default settings of only those dialogs

Close QTP

Delete file “QTOTAWrapper.FileDialogSettings.xml” under following path %appdata%\HP\QuickTest Professional\ (Start > Run > type given path)

Start QTP and try again

Rollback entire set of QuickTest Professional’s settings

Close QTP

Open Windows Registry Editor (Go to the Start menu, select “Run”, type “regedit” and click “Ok”)

Navigate to HKEY_CURRENT_USER\Software\Mercury Interactive

Right click on “QuickTest Professional” folder, select “Export” and save the file prompted

Right click on “QuickTest Professional” folder and select “Delete”\

Browse to profile’s application data (Go to the Start menu, select “Run”, type “%appdata%\HP” and click “Ok”) and rename folder called “QuickTest Professional” to “QuickTest Professional.BAK”

Launch QTP

Perform a full clean uninstallation/reinstall of the tool if none of the above works


Visual Relation Identifiers (VRI) option does not work if XPath is defined

An object is learned inside a web page and is used as a template for another web page. For identifying the object, Visual Relation Identifiers properties are applied.

Trying to recognize the object in the second web application fails. The objects needs to be updated, then the description does not work on the first application.

Visual Relation Identifiers do not work if the following option is set:

Options -> Web -> Advance -> Learn and Run using automatic XPath identifiers.

This option is checked by default. The auto XPath is not visible by design since it is an automatically generated property.

There is an issue with VRI (Visual Relation Identifiers) in cases where a learned object is used as a ‘template’ and then the specific object is identified by changing the VRI setting (or the object indexer). Since the check for matching an element to XPath is done before VRI (or indexer), the web agent will always return the original element and the VRI settings will not match (or the indexer will be ignored).

To resolve this problem, disable XPath:

1. Go to Options -> Web -> Advance

2. Clear the Learn and Run using automatic XPath identifiers option.

Another solution:

For specifying a user defined XPath there is the XPath property that will override the automatically generated one. Add the _path property to the object in the Object Repository and leave it empty. This will rewrite the value in the options settings.

For documentation regarding auto XPath see:

• HP QuickTest Professional Add-ins Guide > Overview > Testing Web-Based Applications > Understanding Web Object Identifiers > Web Object Identifier Types

• HP QuickTest Professional Add-ins Guide > Overview > Testing Web-Based Applications > Understanding Web Object Identifiers > Considerations for Working with Web Object Identifiers

How to get current system time up to milliseconds

Use the Timer function to get the current amount of Seconds (including milliseconds) elapsed since 00:00:00. This sample code will get the time in format HH:MM:SS,mmss and report it to QTP results for the current step:

lSeconds=timer() ‘gets the current time in seconds, milliseconds

lHrs = Int(lSeconds / 3600)

lMinutes = (Int(lSeconds / 60)) – (lHrs * 60)

lSeconds = lSeconds – (lHrs * 3600) – (lMinutes*60)

TransTime = lHrs &":"&lMinutes&":"&lSeconds

msgbox TransTime

Reporter.ReportEvent 2, "Transaction time", TransTime ‘ sends the formatted time to the report

Browser operations (Back, Forward, Home, Refresh, Navigate, Object, etc.) return “General Run Error” or are not executed

QuickTest Professional records scripts with methods such as HOME, BACK, FORWARD, REFRESH, .Object and during play back, any of the methods from the Browser object return “General Run Error”. Another situation may be that Browser.Navigate statements isn’t getting recorded and if manually coded, such get skipped or not executed.

Example script showing issues:

Browser("Browser").Page("Page").WebEdit("q").Set "hello"



Browser("Browser").Back ‘ —> Error "General Run Error"


Browser("Browser").Forward ‘ —> Error "General Run Error"


Browser("Browser").Navigate "www.yahoo.com" ‘ —> Skipped or Ignored


Browser("Browser").Refresh ‘ —> Error "General Run Error"

Print Browser("Browser").Object.HWND ‘ —> Error "General Run Error"


The Browser Helper Object Internet Explorer (IE) Add-on "BHOManager Class" from HP/Former Mercury Interactive for QuickTest Professional (QTP), reference of BHOManager.dll under %windir%system32, takes care of BROWSER test object methods such as BACK, FORWARD, HOME, REFRESH, NAVIGATE, .OBJECT (among others) when is enable.

If the mentioned Class/DLL functionality gets blocked/disabled/not-loaded on browser by either of following situations, errors or unexpected behavior may occur while running scripts:

Internet Explorer required setting "Enable third-party party browser extensions" is disabled

%windir%\System32\BHOManager.dll file doesn’t exist

%windir%\System32\BHOManager.dll file wasn’t registered properly during installation process

%windir%\System32\BHOManager.dll file is corrupted

Other currently active Internet Explorer Add-ons of Browser Helper Object type conflict with QTP Add-on

BHO registry keys settings aside from one from QTP are conflicting between each other (under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Browser Helper Objects)

Old registry keys settings from previous versions of QTP (under HKEY_CURRENT_USER\Software\Mercury Interactive\Browser Helper Objects\AgentsKeys)

Note: Paths including "%" (percentage) symbol, usually invoke a operating system environmental variable. To know the actual path either of following can be done:

On "Start" menu, go to "Run", type the provided path with the % symbol (i.e. %temp%), and press "Enter" key or click "Ok" button

Check the operating system’s environmental variables, and search for one enclosed between the % symbols (i.e. "%temp%", then find "temp") among ones being listed for such Windows. For more information see http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/environment_variables.mspx?mfr=true

Among the detected examples of other public add-ons of Browser Helper Object type conflicting with QTP’s Browser Helper Object Add-on, McAfee "SiteAdvisor" Internet Explorer Add-on appears to disables the BHO from "Mercury Interactive" (QTP Web Internet Explorer Add-on).

McAfee included has 2 different items as Add-ons on IE: 1) "SiteAdvisor" (Browser Helper Object) and 2) "McAfee SiteAdvisor" (Toolbar). For more information about McAfee SiteAdvisor http://en.wikipedia.org/wiki/SiteAdvisor

Internet Explorer required settings are disabled

The setting "’Enable third-party party browser extensions" doesn’t control if BHOManager or other Internet Explorer Add-ons are listed or not under IE > Manage Add-ons, it actually affects its functionality (if this setting is "cleared/unchecked/disabled", then BHOManager won’t work).


Open Internet Explorer

Go to Tools > Internet Options > Advanced

Under ‘Browsing’ category check the option ‘Enable third-party party browser extensions’

Click ‘Apply’ and ‘OK’

NOTE: Above steps can be done/checked via registry:

HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main

"Enable Browser Extensions"="yes"

Restart Internet Explorer in order for the changes to take effect (no need to restart QTP)

Currently active Internet Explorer Add-ons of Browser Helper Object type conflicting with QTP "BHOManager Class" IE Add-on

Disable all Internet Explorer (IE) Add-ons except for "BHOManager Class" from "Mercury Interactive Corporation", and start testing one by one the add-ons your IE instance has installed on it. For more information about troubleshooting IE, see http://support.microsoft.com/kb/883256

BHOManager Class Add-on is missing

The Antivirus program that is running might be preventing the BHOManager.dll from being installed. Temporarily stop the service, register the BHOManager dll and restart the service.

BHOManager.dll file doesn’t exist

Verify that the under the path %windir%\system32 the file "BHOManager.dll" exist with the mentioned name. If it doesn’t then running the Repair option of the product may restore it existence on mentioned path. If such option doesn’t sets a copy of the file on such path, then contact your system administrator for any permissions limitations the user profile using the option may have. Testing another user with full administrator privileges may be of use to know about permission issues.

BHOManager.dll file wasn’t registered properly during installation process

Check that under the IE list of Add-ons (be sure to select to show all, not just currently loaded), the BHOManager Class from "Mercury Interactive Corporation" is shown, otherwise the mentioned methods may present issues/errors when replayed. If such isn’t listed, then try registering the BHOManager.dll file:

Close all browser windows and QTP

Open a command prompt (On the "Start" menu, select "Run", then type "cmd" followed by clicking the "Ok" button)

Run command: "regsvr32 %windir%\System32\BHOManager.dll"

Wait for confirmation indicating that such command ran successfully

Old registry keys settings from previous versions of QTP

When migrating between QTP versions, old references to paths that don’t exist may overwrite existing paths, not fully loading the BHOManager Class functionality:

Close all browser windows and QTP

Access Windows Registry Editor (On the "Start" menu, select "Run", then type "regedit" followed by clicking the "Ok" button)

Navigate to key:

HKEY_CURRENT_USER\Software\Mercury Interactive\Browser Helper Objects\AgentsKeys

Backup key mentioned on step 3 (select key, right click to select "Export" and save REG file with key’s information).

NOTE: Hewlett-Packard recommends consulting your System/IT administrator for any registry configurations

Delete entry: {95D11A40-0F78-45A1-AADA-E89DBBF6C5B7}

Note: if WinRunner is installed on same machine key {B7DB7E5A-81FD-11D1-8B75-0080C83788F7} will be present

Other BHO registry keys settings conflicting in the background are conflicting between each other

In occasions settings from old QTP BHOManager instances or from other Browser Helper Object Add-ons may cause issues due to old references:

Close all browser windows and QTP

Access Windows Registry Editor (On the "Start" menu, select "Run", then type "regedit" followed by clicking the "Ok" button)

Navigate to key:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Browser Helper Objects

Backup key mentioned on step 3 (select key, right click to select "Export" and save REG file with key’s information). Note: HP recommends consulting your System/IT administrator for any registry configurations

Rename (or delete) registry key:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Browser Helper Objects

Reboot machine (not simple log-off, actual restart of entire machine)

BHOManager.dll file is corrupted

If all the above has failed to resolve issue, the related file and possibly others which such depends on (from QTP end), may be corrupted to which HP suggest proceeding with a clean re-installation of the product, however specific

How to perform a clean uninstall and reinstall of QuickTest Professional

Here are the steps for a clean uninstall/reinstall of QuickTest Professional :

1. Backup the LSERVRC file. Such contains licensing information. If you do not save it, you will need to reenter the license code.

Note: If you are using a concurrent license, step #1 isn’t required since such file should be located on the license server machine. However, if file is found on client machine, it is recommended to back it up.

2. Backup your test scripts if such reside under QTP’s installation folder (Default: <QTP Install folder>\Tests)

3. For QuickTest 8.2 and higher, uninstall any non-core add-ins from Add/Remove Programs under Control Panel (Start menu -> Control Panel ->Add Remove Programs)


• Add-in versions higher than 6.5 and below or equal to 9.2 have separate uninstall process, meaning their own particular items within the Add/Remove Programs to allow their removal

• Add-in versions for QTP 6.5 and below, 9.5 and higher come bundled with core, so uninstall such to remove add-ins

• Extensibility Add-ins such Web, .NET and Java (Delphi Add-in isn’t considered of this type) are separate items under Add/Remove Program listing

• Quality Center Add-in is always a separate add-in that requires a particular removal/uninstallation.

• IMPORTANT: If the necessary steps to first remove add-ins (for those which aren’t considered bundled with QTP core) aren’t performed, there may be repercussions such as preventing installation of newer versions of QTP and/or other add-ins such as the Quality Center one.

4. Uninstall QuickTest (Control Panel -> Add Remove Programs).

5. Go to the install directory of QuickTest. The default directory is "C:\Program Files\Mercury Interactive\QuickTest Professional/" or "C:\Program Files\HP\QuickTest Professional".

Note: When working with a 64bits operating system, ensure to locate the above folders under C:\Program Files(x86)\…

6. Delete all the directories under this directory except for the "Tests" folder since it might contain test scripts. If you backed up the test scripts to a different directory in step 2, you can delete the Tests folder also.

Note: The above steps can be performed via command line:

rmdir /s /q "C:\Program Files\HP\QuickTest Professional"

The following steps relating to HKEY_CURRENT_USER must be performed for each user on a Citrix or Terminal Services environment, and for any user that has run QuickTest Professional)

7. Open the registry editor (Start -> Run -> regedit)

8. Navigate to the following registry key:

HKEY_CURRENT_USER\Software\Mercury Interactive\QuickTest Professional

9. Backup/export mentioned key (right click, select "Export", then save the file)

10. Delete the "QuickTest Professional" folder (including all the keys and values under it)

11. Navigate to Browser Helper Objects section:

HKEY_CURRENT_USER\Software\Mercury Interactive\Browser Helper Objects\AgentsKeys

12. Backup/export mentioned key (right click, select "Export", then save the file)

13. Browse sub keys under "AgentsKeys" and remove/delete ones showing a "Path" value pointing to a QTP installation location. For example on a QTP10/11 machine:

HKEY_CURRENT_USER\Software\Mercury Interactive\Browser Helper Objects\AgentsKeys\{95D11A40-0F78-45A1-AADA-E89DBBF6C5B7}

"Path"="C:\\Program Files\\HP\\QuickTest Professional\\bin"

Note: When "Path" entry isn’t correct, Web Add-in could not function correctly. After deleting it (recommended), ensure performing steps/solutions of following article in given order – Browser operations (Back, Forward, Home, Refresh, Navigate, Object, etc.) return "General Run Error" or are not executed

14. Navigate to the following registry key:

HKEY_LOCAL_MACHINE\SOFTWARE\Mercury Interactive\QuickTest Professional

Note: When working on a 64bits operating system, the above key may not exist, instead following key should:

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Mercury Interactive\QuickTest Professional

15. (Important) The HKEY_LOCAL_MACHINE\SOFTWARE\Mercury Interactive\QuickTest Professional key contains license information. HP Support recommends backing up the key first (right-click on the "QuickTest Professional" key and select Export).

16. Delete the "QuickTest Professional" folder (including all the keys and values under it).

Steps 7 to 16 could be done accordingly via command line (or a batch file or with extension *.bat), for example here are some of those, not all:

Export/Backup registry:

REGEDIT /e C:\HKCU_QTP.reg "HKEY_CURRENT_USER\Software\Mercury Interactive\QuickTest Professional"

REGEDIT /e C:\HKLM_QTP.reg "HKEY_LOCAL_MACHINE\Software\Mercury Interactive\QuickTest Professional"

64bit OS: REGEDIT /e C:\HKLM_QTP.reg "HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Mercury Interactive\QuickTest Professional"

Delete registry:

REG DELETE "HKCU\Software\Mercury Interactive\QuickTest Professional" /f

REG DELETE "HKLM\Software\Mercury Interactive\QuickTest Professional" /f

64bit OS: REG DELETE "HKLM\SOFTWARE\Wow6432Node\Mercury Interactive\QuickTest Professional" /f

If it were required to Import settings from exported REG files, then:



17. (If found on specified path) Delete BHOManager.dll in %windir%\system32 folder. For 64bits, is possible to find it under %windir%\SysWOW64 folder. If not found such could have being removed uninstall process. Best to check by doing search on entire file system (all hard drive units, exclude shared drives as well as CD/DVD drives).

18. (If found on specified path) Delete the following assemblies from the C:\Windows\assembly\ directory:

• Mercury.QTP.Agent

• Mercury.QTP.CustomServer

• Mercury.QTP.WpfAgent

• policy.6.5.Mercury.QTP.CustomServer

• policy.8.0.Mercury.QTP.Agent

• policy.8.0.MngUtils

• policy.X.X.Mercury.QTP.WpfAgent ("X" could 9.5 or 10.0. This item may appear repeated, just different version, so delete them all)

19. If working with QuickTest Professional 11.0 and NET 4.0 support was enabled, then delete the following directory and contents under Windows folder (Go to "Start" menu, select "Run", type "%windir%", click "Ok"):

• C:\Windows\Microsoft.NET\assembly\GAC_32\Mercury.QTP.Agent\

• C:\Windows\Microsoft.NET\assembly\GAC_64\Mercury.QTP.Agent\ (Note: If 64bits support is enabled)

• C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Mercury.QTP.WpfAgent

Note: Following command lines may help achieving required tasks:

rmdir /s /q %windir%\Microsoft.NET\assembly\GAC_32\Mercury.QTP.Agent

rmdir /s /q %windir%\Microsoft.NET\assembly\GAC_64\Mercury.QTP.Agent

rmdir /s /q %windir%\Microsoft.NET\assembly\GAC_MSIL\Mercury.QTP.WpfAgent

20. If the Firefox browser is installed go to Tools->Add-ons and manually remove the QuickTest Professional PlugIn

21. For QTP 9.5 and above, delete/rename the associated application data "QuickTest Professional" directory. (Start -> Run -> type "%appdata%\HP" -> Ok). Following are command line options:

Delete folder:

rmdir /s /q "%appdata%\hp\QuickTest Professional"

Rename/Backup folder:

rename "%appdata%\hp\QuickTest Professional" "QuickTest Professional.bak"

22. Reboot the machine (recommended)

23. Install or reinstall QuickTest Professional.

24. If step #1 is applicable to machine in question, copy back the lservrc file into the correct directory. Note: As long as the locking code (which is machine specific) did not change, you should be able to use QuickTest Professional without having to re-enter the license code.

“Expected identifier” error takes place when replaying a SAP test recorded using a localized version of QuickTest Professional 10.0

When recording a SAP test against SAP GUI 7.10 on a computer where the User Interface Pack is installed, QuickTest Professional replaces the method names in recorded steps by gibberish characters. These characters cause the test to fail with an "Expected identifier" error during replay.

For example, QuickTest Professional will record:


Instead of:

SAPGuiTable("Table_Name").Input "…"

To fix the problem install hotfix "QTPSAP_00010 – Prevent Method Names from Being Recorded as Non-English Characters When Using SAP Add-in with a Localized Version of QuickTest".