New Ranks & Badges For The Community!
Notice something different? The ranks and associated badges have gone "Star Fleet". See what they all mean HERE
Highlighted
Absent Member.
Absent Member.
7402 views

QTP not recognizing WPF Objects. QTP Version: 11, .Net - 4.0, Windows 7

Hi,

 

I have to create QTP scripts for a new application. It is WPF/.NET client application written in C#.

I am working on a Windows 7 system using QTP 11.

 

When I spy over the application window, QTP recognises only the main window as WPFWindow but the child objects are not recognized.

 

Please suggest a solution.

0 Likes
4 Replies
Highlighted
Absent Member.. Absent Member..
Absent Member..

Try the following steps.

 

1) Close QTP and any other application.

2) Open a CMD (command prompt)

3) Navigate the following path on your local file system: <<QuickTest installation folder>>\GlobalAssemblyCache\Net4

4) Execute the following commands:

 

..\..\bin\GACRegUtil4x86.exe -i Mercury.QTP.Agent.dll

..\..\bin\GACRegUtil4x86.exe -i Mercury.QTP.WpfAgent.dll

 

5) Check if this works, If no then try steps from 6 to 8.

 

 

6) 1. Copy from "C:\Program Files (x86)\HP\QuickTest Professional\GlobalAssemblyCache\Net4\Mercury.QTP.Agent.dll" to this directory structure "%windir%\Microsoft.NET\assembly\GAC_32\Mercury.QTP.Agent\v4.0_8.0.137.0__7d38df5e43b1c39a".

 

7. If QTP_00669 (OR 64bits support patch) is in play, then copy "C:\Program Files (x86)\HP\QuickTest Professional\GlobalAssemblyCache\Net4\Mercury.QTP.Agent.dll" to directory structure "%windir%\Microsoft.NET\assembly\GAC_64\Mercury.QTP.Agent\v4.0_8.0.137.0__7d38df5e43b1c39a".

 

8. If WPF 4.0 support is related, then copy "C:\Program Files (x86)\HP\QuickTest Professional\GlobalAssemblyCache\Net4\Mercury.QTP.WpfAgent.dll" under "%windir%\Microsoft.NET\assembly\GAC_MSIL\Mercury.QTP.WpfAgent\v4.0_9.5.1000.0__7d38df5e43b1c39a" /y.

 

If this doesn’t works then try steps from 9 to 12

 

9. Open the directory c:\windows\assembly\

10. Check that two files called Mercury.QTP.Agent exist. Process Architecture should indicate AMD64 and a blank value

11. If the assembly with the process architecture of AMD64 is missing, drag and drop the file

            C:\Program Files (x86)\HP\QuickTest Professional\bin64\Mercury.QTP.Agent.dll

            to

            c:\windows\assembly\

12. If the assembly with the process architecture of blank is missing, drag and drop the file

            C:\Program Files (x86)\HP\QuickTest Professional\GlobalAssemblyCache\Mercury.QTP.Agent.dll

            to

            c:\windows\assembly\

Highlighted
Cadet 1st Class
Cadet 1st Class

I am facing this problem in W7 alone (working fine in XP).

 

i followed the steps, the cmd prompt didnt work for me, so followed from 9-12, the Merqury agent files already exist

Also Mercury.QTP.wpfAgent two file exist Both with ProcessorArchitecture as MSIL.

 

but still QTP 11.0 not identifying WPF objects except main window...

0 Likes
Highlighted
Absent Member.. Absent Member..
Absent Member..

I get this error when executing the first command:

 

Failed to load information for Mercury.QTP.Agent.dll with error: Could not load
file or assembly 'file:///C:\Program Files (x86)\HP\QuickTest Professional 11\Gl
obalAssemblyCache\Net4\Mercury.QTP.Agent.dll' or one of its dependencies. An att
empt was made to load a program with an incorrect format.

 

I am able to use the Object Spy to 'learn' objects, but cannot start the application from QTP and cannot record anything.

Application is done in WPF protocol and I've selected .NET, Web, WPF and Silverlight

 

Would really appreciate it if I can get a timely reply. Thanks in advance

0 Likes
Highlighted
Absent Member.
Absent Member.

Spoiler
 

Hi,

 

Check if you have sufficient permissions as per following article: http://support.openview.hp.com/selfsolve/document/KM183747

 

And, make sure you have critical updates for QTP 11 in place (http://support.openview.hp.com/selfsolve/document/KM1054571)

as well as latest updates for .NET, WPF & Silverlight:

 

Silverlight, .NET (Swf)

Silverlight 5 Apps

QTPNET_00120 +

QTPNET_00153

 

WPF (32-bit)

Cumulative for 32-bit WPF Apps

QTPNET_00120 + QTPNET_00147 + QTPNET_00152

 

WPF (64-bit)

Cumulative for 64-bit WPF Apps

QTP_00699 + QTPNET_00120 + QTPNET_00148 + QTPNET_00152

 

 

Regards,

Ana

“HP Support
If you find that this or any post resolves your issue, please be sure to mark it as an accepted solution.”
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.