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.

Learn objects in UI Automation mode

  1. 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.
  2. 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
    1. In the Item cell, from the drop-down list, select Object from repository.

    2. In the Select Test Object dialog, from the pointing hand button, click the drop-down arrow and select UI Automation.

    3. Click the pointing hand button. UFT is minimized.

    4. Select the object from your application. The object is added (with its parent objects if necessary) to the Select Test Object dialog box.

    5. Click OK. The object is now added to the local object repository.

    Back to top

Record steps in UI Automation mode

  1. In the toolbar, click the Record button .

  2. 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.

Note:  

  • 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.

Back to top