UFT automation scripts

Relevant for: GUI tests and components

The UFT automation object model is a set of test objects, methods, and properties that represent elements in the UFT user interface, enabling you to control UFT from other applications.

Use the automation object model to write Visual Basic scripts that control UFT to modify configuration and run settings. This is helpful when you need to define the same settings multiple times, or on multiple tests and components, or quickly configure UFT for a specific environment or application.

UFT automation object model scope

Most UFT UI elements and options are supported in the automation object model as follows:

Dialog boxes Most UFT dialog boxes have a corresponding automation object.
Options in dialog boxes Most options in UFT dialog boxes have a corresponding object property.
Menu commands and other operations Most UFT menu commands and other operations have corresponding automation methods.

Design your automation script using the objects, methods, and properties exposed by the UFT automation object model, along with standard programming elements such as loops and conditional statements.

For more details, see Application Object and the UFT Automation Object Model Reference .

Back to top

Sample automation scenarios

The following are two common scenarios of where you might use UFT automation scripts.

Configure your team's testing configuration

Use the automation object model to create a script that opens UFT with specific configuration settings.

Instruct all your tests to open UFT using this automation script to ensure that all your entire team works with the same configuration.

Run tests and components

Create a script that performs the following steps to define specific settings and run a UFT test or component.

  1. Start UFT.

  2. Load a required add-in.
  3. Open a test or component.

  4. Configure settings in the:

    • Options dialog box

    • Test Settings or Business Component Settings dialog boxes

    • Record and Run Settings dialog box

  5. Save and run the test or component.

Add a loop to your script to enable you to use the same script on multiple tests and components.

Back to top

See also: