Use UFT One UI Automation support

Relevant for: GUI tests and components

This task describes how to properly use UFT One's UI Automation support, which helps you identify objects in your application when UFT One's regular object identification support is not sufficient for your needs.

Note: Before you use UFT One'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 One.

UFT One'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.

Spy on objects in UI Automation mode

Do one of the following:

  • In the Object Spy, click the pointing hand drop-down arrow, select UI Automation, and click the button to spy on objects in UI Automation mode. For details, see Use the Object Spy.

  • In the Object Identification Center, click the UIA icon to spy on objects in UI Automation mode. For details, see Use the Object Identification Center.

Object properties are displayed as they would be recognized using UI Automation instead of their native technology.

Back to top

Learn objects in UI Automation mode

  1. Activate the UI Automation mode in UFT One 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 Manager or Object Repository window

    Do one of the following:

    • Use the Add UI Automation Objects button .

      The Add UI Automation Objects button is available only if you have selected UI Automation from the Learn mode dropdown in the 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 One 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.

For more details, see Record a GUI test or component.

Back to top

Recognize Delphi objects using UI Automation

Use the UI Automation Add-in to recognize objects in your Delphi applications as follows:

  1. When you start UFT One, enable both the Delphi and UI Automation Add-ins.

  2. Spy, learn, or record on your Delphi control using UI Automation mode.

  3. In the Object Repository, manually add the following properties to the new UI Automation object:

    • delphi_name
    • delphi_path
  4. Manually remove the default name property.

Back to top

See also:

  • For more details, see the UI Automation section of the UFT One Object Model Reference.