Small Cheese

QTP11 Unrecognized Objects And Hit Application Error After Upgrading To .Net Framework 4

Recently I encountered some problem after upgrading the .Net Framework 4 , it cause the QTP unrecognized the existing objects and hit application error when executing the scripts.

This kind of problem only happen to the desktop application however the web based application is working good ( for my testing environment). If the application install as an add-in to Office Excel 2007 and you need to run the scripts to test the add-in, you may hit .NET Runtime 4.0 error reporting like what I had encountered.

The .Net Framework Hit Error When Running QTP Script To Test Add-In That Installed In Excel 2007
The .Net Framework Hit Error When Running QTP Script To Test Add-In That Installed In Excel 2007

Microsoft .Net Framework 4 Error Log Detail
Microsoft .Net Framework 4 Error Log Detail

Another problem is the QTP unrecognized existing objects that captured previously. This is the sample of the test scripts problem where the object has been changed.

Before upgrading to .Net Framework 4
SwfWindow("Maintenance").SwfObject("DeleteButton").Click

Unrecognized object after upgrading .Net Framework 4 because the script read as below
Window("Maintenance").SwfObject("SwfObject").Click

I have tried for almost 4 hours to fix this problem, because there is not much information sharing in internet regarding this .net framework issue. I am really happy this can be resolved otherwise I have to redo all the existing QTP scripts.

To resolve QTP unrecognized objects and application error you can do this.

Steps
1. Uninstall QTP11 and the application that for testing.
2. Uninstall all versions of .Net Framework (e.g. by using .NET Framework Cleanup Tool, with reference to Aaron Stebner’s post).
3. Reboot the machine and then install .Net Framework 4.
4. Perform Windows update and confirm all the high priority updates are installed.
5. Reboot the machine and then install QTP11.
6. Install the application for testing, and now you should be able to run the existing scripts without error and existing object remain unchange.


Custom Search