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 are automatically populated in MBT. For details, see Set up 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.
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 indicates 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 Set up 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. Priority
You can add the Priority field if needed.
If you choose High or Low priority, this is indicated on the unit's card and in the preview pane.
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 Basics.
(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. The input parameter is the book title, and the output is the book's internal item ID. This parameter can then be the input parameter in the next unit in your model, which takes the item ID as input, and generates 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.
When you work with MBT, you see summary information on the unit cards in the context of your models and testing paths.
In the Models tab, unit cards include details on related backlog items, latest execution results, and risk. Tooltips show additional information where relevant.
In the Paths tab, units in the Path Preview pane display information related to your strategy. If you select the Agile Based strategy, you see details on related items. If you select Unit Recent Failure strategy, you see latest run results.