A unit represents an actionable component in your model, such as Log in or Purchase. You combine units to create a model for testing.
Each unit represents an action in your application. You create units for each action, and then build a model showing the possible flows between these units. To automate testing, each unit should correspond with a test in your Git repository.
There are two ways to create units:
Manual creation. In this methodology, you create units in MBT, and then connect them with scripts in your Git repository.
Auto-discovery. If you have tests already defined in Git, and you configure a connection to your repository in MBT settings, the units associated with those tests will be automatically populated in MBT. For details, see Configure MBT.
A unit can be assigned to multiple MBT models and tests. If you modify a unit, the change is applied to all related tests and models.
Note: If you change parameters, you will need to create a new test in order to see the updated parameter settings.
Create a unit
This section describes how to create and configure a unit. The instructions on configuring units are also relevant for auto-discovered units.
To create and configure a unit:
Select a folder in the left pane, or create a new folder. This structure enables you to organize your MBT models and units in a way that is meaningful to you.
In the Units tab, click + Unit.
In the Details tab, enter the unit's name, and fill any other fields that are relevant. For example, we recommend that you configure the following:
Field Description Automation status
Specify whether the test covering this unit is automated in your CI server.
When you create an MBT test that covers this unit, the test will indicate what percentage of the test's units are automated, helping you optimize your automation strategy.
If the unit has a corresponding test script in Git, enter the path to the test script in the repository that is defined in MBT settings. For details, see Configure MBT.
Do not enter the full path to the test script, but only the path inside the repository. For example, if a test is located inside <Git repository URL>/UFTtests/Action1, the Repository path is UFTtests/Action1:ActionName.
Testing tool type If the unit has an automated test in UFT One, specify UFT One as the testing tool. Phase
In the upper right corner of the UI, select the Unit's Phase. MBT uses phases to represent the current state of an item. As you work on items, advance them from phase to phase.
When you set a unit's phase to Ready, the icon representing the unit changes color from gray to blue.
Note: For details on working with options in the form such as auto-fill, attachments, or custom fields, see Common functionality in the ALM Octane Help Center.
(Optional) In the Parameters tab, click + Unit Parameter to create input or output parameters for the unit.
For example, you could have a unit whose function is to search for a book, and a book title will be the input parameter. The output will be the book's internal item ID. This parameter could then be the input parameter in the next unit in your model, which would take the item ID as input, and generate a price as its output parameter.
For each parameter, define the following:
Type. Enter either Input or Output.
Name. Enter a name for the parameter.
Default value is optional.
When parameters are used in a UFT One action, the following are required:
The parameter name must be identical in MBT and UFT One. To rename a parameter, click on the parameter name and edit as needed.
The order of the parameters in the unit must be identical in MBT and UFT One. To reorder parameters, select a parameter and click Up or Down in the toolbar.