Use UFT UI Automation support
Relevant for: GUI tests and components
This task describes how to properly use UFT's UI Automation support, which helps you identify objects in your application when UFT's regular object identification support is not sufficient for your needs.
Note: Before you use UFT's UI Automation support, you must:
- Have an application that implements Microsoft UI Automation patterns. For details on support, see the UI Automation overview on MSDN.
- Load UI Automation in the Add-in Manager when starting UFT
UFT's UI Automation support uses existing object identification functionality (such as Object Spy, Navigate and Learn, and the like) However, each of these object identification tools must be used in UI Automation mode.
In the Object Spy, click the pointing hand drop-down arrow, and select UI Automation.
Continue to spy your objects as you would otherwise.
Object properties are displayed as they would be recognized using UI Automation instead of their native technology.
Activate the UI Automation mode in UFT before learning the objects.
- Select the Use UI Automation by default open in the Windows Applications > Advanced pane of the Options dialog (Tools > Options > GUI Testing tab > Windows Applications > Advanced node).
- In the Object Repository Manager window, select UI Automation from the Learn mode dropdown in the toolbar.
Add objects to your object repository using one of the following:
In the Object Spy Add Object to Repository button In the Object Repository window or Object Repository Manager
Do one of the following:
Add UI Automation Objects to Local button
The Add UI Automation Objects to Local button is not available unless:
You select the Use UI Automation by Default option in the Windows Applications > Advanced pane of the Options dialog box; and
You have activated the UI Automation mode by clicking the UI Automation button in the Object Repository window toolbar.
Add test objects using the Navigate and Learn toolbar
In the Keyword View
In the Item cell, from the drop-down list, select Object from repository.
In the Select Test Object dialog, from the pointing hand button, click the drop-down arrow and select UI Automation.
Click the pointing hand button. UFT is minimized.
Select the object from your application. The object is added (with its parent objects if necessary) to the Select Test Object dialog box.
Click OK. The object is now added to the local object repository.
In the toolbar, click the Record button .
In the Record Toolbar, from the Recording mode drop-down list, select UI Automation Recording.
All steps performed are now recorded as UI Automation objects, even if the object type can be recognized as another regular UFT test object.
Recording may add additional unnecessary steps to your test. Remove the unneeded steps manually after finishing your recording session.
If you are recording to add a checkpoint or output value, ensure that the UI Automation Recording mode is selected before you click the Insert Checkpoint or Output Value button .
The speed of UI Automation recording can vary depending on the application.
For more details, see Record a GUI test or component.
Use the UI Automation Add-in to recognize objects in your Delphi applications as follows:
When you start UFT, enable both the Delphi and UI Automation Add-ins.
Spy, learn, or record on your Delphi control using UI Automation mode.
In the Object Repository, manually add the following properties to the new UI Automation object:
Manually remove the default name property.
For more details, see the UI Automation section of the UFT Object Model Reference.