UFT One automation scripts
Relevant for: GUI tests and components
The UFT One automation object model is a set of test objects, methods, and properties that represent elements in the UFT One user interface, enabling you to control UFT One from other applications.
Use the automation object model to write Visual Basic scripts that control UFT One 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 One for a specific environment or application.
UFT One automation object model scope
Most UFT One UI elements and options are supported in the automation object model as follows:
|Dialog boxes||Most UFT One dialog boxes have a corresponding automation object.|
|Options in dialog boxes||Most options in UFT One dialog boxes have a corresponding object property.|
|Menu commands and other operations||Most UFT One menu commands and other operations have corresponding automation methods.|
Design your automation script using the objects, methods, and properties exposed by the UFT One automation object model, along with standard programming elements such as loops and conditional statements.
For more details, see Application Object and the UFT One Automation Object Model Reference .
Sample automation scenarios
The following are two common scenarios of where you might use UFT One automation scripts.
Configure your team's testing configuration
Use the automation object model to create a script that opens UFT One with specific configuration settings.
Instruct all your tests to open UFT One 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 One test or component.
Start UFT One.
Load a required add-in.
You can skip this step if the script will only open existing tests or business components and run them. When opening a test or business component, UFT One dynamically loads its associated add-ins. For details, see Loading add-ins that were not loaded at startup.
Open a test or component.
Configure settings in the:
Options dialog box
Test Settings or Business Component Settings dialog boxes
Record and Run Settings dialog box
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.