Site icon Automation Dojos

Common Errors with QTP/UFT – Part 2

Welcome to the second and final part of this series on ‘Common Errors for QTP/UFT’! Earlier, we discussed about some of the ‘Common QTP/UFT Installation Issues’.

In this post however we shall be discussing some assorted issues which you may face, when using both QTP/UFT and ‘JAVA’ related tools and software (e.g. JDK, Eclipse IDE), on the same machine. This article also explains the possible fixes or workarounds to overcome each issue. Hope that helps!

Eclipse/QTP/UFT does not work after Java update

When a machine runs QTP and Java Applications, there are certain configuration conflicts. Users experience unexpected behaviour of QTP or Java. One of the common issues with QTP and Java is that Eclipse workspace does not load when you run the program. There are different errors that can be seen:

Case 1 : There is no error message. The program blinks for a second and goes off

One of the possible reasons is that you have downloaded Java SDK plugin from HP and environmental variables prevent Java application from loading. In that case, there should not be any issue with the Eclipse workspace. You can confirm this by changing the SHOW_WORKSPACE_SELECTION_DIALOG argument to True. This issue occurs on machines that run QTP. The reason is that QTP sets a value to environmental variables JAVA_OPTIONS AND JAVA_TOOLS_OPTIONS.

To run Eclipse, you have to delete these environmental variables. However, that gives another problem. Now, QTP doesn’t recognize Java or Oracle objects. The best way to resolve this issue is to make Java Support load only when Java add-ins or Oracle add-ins are running with QTP. Follow these steps to achieve this:

  1. Close all Java applications.
  2. Close QTP
  3. Click on Start -> Control Panel -> Java Control Panel
  4. Go to Advanced Tab -> Default Java for Browsers
  5. Uncheck the box for Internet Explorer and close the Java Control Panel
  6. Go to the Registry Editor. Start -> Run -> RegEdit
  7. Click the + beside HKEY_Local_Machine -> Software -> Mercury Interactive -> JavaAgent -> LoadDependsOnPackage
  8. Select 32-bit OS or 64-bit OS according to your configuration
  9. The default value is set to 0. Change it to 1 so that the agent will be loaded only when the application is loaded.
  10. Close the Registry Editor and restart the system
Case 2 : Error Message - NoClassDefFoundError

Another common error encountered while upgrading to QTP 11 from QTP 9.5 or QTP 10, the upgrade is successfully done. However, when you open the application, it does not open or behaves unexpectedly. This is commonly seen with systems that use local versions of the HP software.

When you open Eclipse, it gives an error NoClassDefFoundError. This issue might be a result of corrupt Java (JDE/JRE) software. When you run the Eclipse archive on another system, it should work fine.

To resolve this issue, uninstall the Java program suite and the QTP software. Then, freshly install Java and then install QTP. When QTP is installed on a machine that has a proper Java environment, it should work fine.

Case 3 : Error message - “An error has occurred. See the log file”

Consider an instance wherein you open the Eclipse and it gives an error message to check the log file. This is again caused by Java update. Check if you have installed JRE updates recently. Sometimes, you might install two versions of JRE and a conflict arises.

To resolve this issue, uninstall Java environment and Eclipse and reinstall them again.

Case 4: QTP behaves unexpectedly

In certain cases, QTP behaves unexpectedly and you experience the following issues:

  • QTP does not recognize the window and no recording is done
  • Missing toolbars or tabs
  • Coding error

The simplest way is to restart your machine and check if the issue is resolved. If that does not work try the following :

  • Check if all add-ins are selected.
  • Corrupt user profiles can prevent the program from working in its fullness.
  • Check out if your user profile is intact. To do so, create another user account and login into the program to see if the issue is resolved.
  • Another area to check out is whether you are logged in as an administrator. QTP requires an administrator account for certain tasks.
  • Reinstalling the software should be the last resort. Before doing that, check if there are any QTP patches released for the issue you are experiencing.
Exit mobile version