I have repeated this many times in the past and it is still remains the #1 object identification tip. While testing on any app, make sure UFT/QTP is opened first and then your application. UFT works by hooking into your application. If you open UFT after your application has started there are chances that UFT may not be able to identify objects.
Make sure you have loaded ALL the relevant add-ins required for your Application Under Test (AUT).
While working on web based applications, make sure Record and run test on any open browser is selected under Record > Record and run settings.
Make sure BHO Manager in IE under Tools > Manage Add-Ons > Enable or Disable Addons is enabled.
If you are working on Firefox or Google chrome browser, don’t forget to enable browser extensions.
In case of Firefox go to Firefox menu > Add-ons > Extensions and enable Unified Functional Testing Extension .
For Chrome go to Tools > Extensions and enable Unified Functional Testing Agent.
In IE, clear the Enable Protected Mode option under Tools > Internet Options > Security
Data Execution Prevention (DEP) is a technology by Microsoft to protect your machine from running malicious code and viruses.
In a given machine, DEP can be set to Always On or it can be set to On For Essential Processes.
if you are on Windows 7 64 bit or Windows Server 2008 R2 or in general having a hard time with UFT behaving inconsistently, you may want to set DEP to the latter option. Here is how it can be done on Windows 10 (procedure for earlier OS like Windows 7, XP would remain the same)
Hit Windows + R key combo. The shortcut to go to DEP window direct from Windows run dialog box is SystemPropertiesDataExecutionPrevention (copy-paste the command). You will get this dialog box.Now ensure that the first radio button is selected and not the second.
If for some reason the shortcut doesn’t work in your machine, you can:
- Right click on Windows Start logo
- Click System
- Click Advanced System Settings on the left side
- Under System Properties dialog box, go to Advanced Tab
- Click Settings… button under Performance section
- Go to Data Execution Prevention Tab.
Here you will find the same options as shown in the image above.
UAC was introduced in Windows Vista and continued in Win 7, Win 8/8.1 and Win 10. UAC can interfere with your application. It is a good idea to disable it while working on QTP.
- To turn-off UAC on Windows 7, go to Start Menu > Search for “Change User Account Settings” > Disable UAC
- To turn-off UAC on Windows 8/8.1, you need to take help of registry. UI setting doesn’t truly turns-off UAC in Win 8/8.1. Hit Win + R key, type regedit and click OK. Navigate to HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\System
Find the key: EbableLUA and change the Value Data value to 0
- To turn-off UAC on Windows 10, go to Control Panel > User Accounts.
- Click on Change User Account Control Settings
- On the next window, drag the slider to the bottom and Press OK.
Make sure the zoom level is set to 100% while testing in any browser. Check the illustration below on how zoom-level affects highlight object functionality in QTP. (Focus on the blinking black rectangle on the left once the Highlight button is clicked on the right.)
A shortcut key to get back to 100% zoom is Ctrl + 0 (that’s zero).
There are times when identification properties are not enough to identify an object. You may make use of native properties in that case. Use .object notation to locate the erring property. Make sure to correctly identify it.
After you have exhausted all options you can try Low level recording. It’s not a good method from maintenance point of view but it may come handy at times.
My QTP/UFT scripts have worked for ages identifying objects correctly, stopped working since yesterday
If something like that has happened probably there is some change in your Windows OS or browser or UFT software itself. Try to disable Windows auto-updates on machines where QTP is installed.
My QTP/UFT web scripts were working fine till the last version but since the time I have upgraded to UFT 12.52, UFT is identifying objects incorrectly.
UFT 12.52 and above versions have the ability to recognize web objects based on their HTML
role attribute, using the Web Accessibility toolkit. This capability is enabled by default in UFT versions 12.52 and above. For example, if an image object has a
role attribute defined , UFT may recognize it as a
WebButton objects instead of an
While this change is done for better object identification abilities in UFT. It may cause object identification issues if you are migrating scripts from others versions of QTP/UFT to UFT 12.52 or above.
To make sure UFT 12.52+ versions continue to identify objects using without using Web Accessibility , you can choose to disable Web Accessibility support.
It can be done by going to registry OR through script in Editor. We will show you both the ways
Disable Web Accessibility support through Registry
- If you are on 64 bits Windows OS, Go to
HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Mercury Interactive\QuickTest Professional\MicTest\Packages\WebPackage\SettingsIf you are on 32 bits Windows OS, Go to
HKEY_LOCAL_MACHINE\SOFTWARE\Mercury Interactive\QuickTest Professional\MicTest\Packages\WebPackage\Settings
- Update key
Disable Web Accessibility support through UFT Editor script
Use this statement at the start of your script to disable Web Accessibility support in UFT
Use this statement at the start of your script to enable Web Accessibility support in UFT
Chrome has a habit of auto-updating itself whenever a new version is released. If your UFT scripts are working fine for a particular version of Chrome and there is no real requirement to remain on the latest version, you can disable automatic chrome updates.
If you’re testing cross browser, don’t use Type property to identify Webbutton class since the default value is different for IE (button) and Firefox (Submit).
If QTP was successfully able to identify object at record time but unable to identify the same object during replay time, there are chances that object properties are dynamic in nature. Make use of regular expression or parameterization to handle those dynamic values.
In case your application version is not supported by the version of QTP, keep an eye on various patches that HP comes up with from time to time. Check the complete support matrix of QTP/UFT with various technologies. We strive to keep this up-to-date.
If nothing works for you, you can ask your question at QTP forums. Please make sure your question is detailed enough to solicit good responses.
That’s it from my side.
You can download this article as an eBook for handy reference.
If you want to keep track of further articles on UFT (QTP). I recommend you to subscribe by Email and have new UFT articles sent directly to your inbox.