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