Custom hooking in UFT
Question ID: 108684

Is there a way to create custom hooking for an addin in UFT for our application?

Marked as spam
Posted by (Questions: 227, Answers: 22)
Asked on October 29, 2018 2:45 pm
Answers (1)
Private answer

Here's an example that you can work from. The below steps show how to do this for Stingrray, but you can follow along with it and substitute for your own needs:

Specific Add-ins Hooks

1. Copy/Paste below text on blank file:

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USERSoftwareMercury InteractiveLeanFTMicTestHooksMgrDllInjectorALWAYS]

[HKEY_CURRENT_USERSoftwareMercury InteractiveLeanFTMicTestHooksMgrDllInjectorALWAYS\MODULES]

2. Delete lines above, according to associated support not interested in forcing. Check below:
Registry Value Name Add-in Support Notes
WpfAgentLdr.dll WPF
acx_trap.dll ActiveX
QTPDelphiAgent.dll Delphi
pb_agnt.dll PowerBuilder
QtAgent.dll Qt
vb_trap.dll Visual Basic

Example:StingrayAgentAgentDllMFC71OG903AS_OT803ASStgAgent.Dll Stingray ObjectiveGrid/ObjectToolkit version specific DLL.

IMPORTANT: Once this is setup for Stingray apps, it may get injected on any app, even non-Stingray apps. Remove this and below Stingray, in case of problems
StgAgentHook.dll Stingray This is the general hook

3. Replace '''' with executable (EXE) file of the desired application, for example ''iexplore.exe''

4. Save file with extension REG, for example: specific.REG

5. (Micro Focus strong recommendation) Before moving forward, backup registry as below:
I. Access Windows Registry Editor (On the ''Start'' menu, select ''Run'', then type ''regedit'' followed by clicking the ''Ok'' button)
II. Navigate to key:

HKEY_CURRENT_USERSoftwareMercury InteractiveLeanFTMicTestHooksMgrDllInjectorALWAYS

III. Right click on ''ALWAYS'' key, select ''Export'' and save REG file: specificHooks.backup.REG

NOTE: Hewlett-Packard Enterprise recommends consulting your System/IT administrator for any registry configurations
6. Double click on the file

7. Click ''Yes'' when asked to merge file into current configuration

8. (Optional) To rollback changes:
I. Navigate to:

[HKEY_CURRENT_USERSoftwareMercury Interactive LeanFT MicTestHooksMgrDllInjectorALWAYS]

II. Right click on e '''' key
III. Select ''Delete''

The mentioned steps are to force the support into the application but this time specifying the add-in that we want to use.

Marked as spam
Posted by (Questions: 2, Answers: 477)
Answered on October 29, 2018 2:47 pm

Welcome back to "EyeOnTesting" brought to you by Orasi Software, Inc.

Scroll to Top