How to Tackle the Issue of QTP Dot Net Addin not Recognizing the NET 4.0 controls
Recently, we had couple of requests from our readers, seeking clue to an erratic behavior by QTP.
The problem statement goes like:
QTP Dot Net addin seems to have an issue with NET 4.0 applications.
Till .NET 3.5 and below, it was working fine. However, objects from .NET 4.0 application is showing a very strange behavior. Most of the objects are getting recognized as “SwfObjects”.
Till .NET 3.5 and below, we could get the hierarchy as:
After moving to .NET 4.0, we are getting hierarchy like this:
Now the question arises
Why SwfWindow objects are being viewed as Window. We have done the installation of .NET framework 4.0 very recently.
The solution / answer goes like this:
The .NET Framework version 4.0 was installed after QuickTest Professional was installed which is the possible issue for this QTP behavior.
When you desire to work on .NET 4.0, then it�s better to firstly install this before the installation of QuickTest Professional. If .NET 4.0 is installed after QuickTest, then you need to register following two .NET DLL files as per the procedure given below.:
1. If working on a 64 bit operating system, you will be required to install patch QTP_00709.
2. Open a command prompt (Start > Run > type “cmd” > Click “Ok”)
3. Navigate to GlobalAssemblyCacheNet4
4. Run the following two commands:
1. ….binGACRegUtil4x86.exe -i Mercury.QTP.Agent.dll
2. ….binGACRegUtil4x86.exe -i Mercury.QTP.WpfAgent.dll
The above mentioned steps should fix this issue.
However, just in case if it doesn�t happen, we would recommend to carryout clean uninstalling of HP QuickTest Professional.
(We will be posting detailed steps to do a clean uninstall very soon in an upcoming article on QTP)
An expert on R&D, Online Training and Publishing. He is M.Tech. (Honours) and is a part of the STG team since inception.