Parameterize object values
Relevant for: GUI tests and scripted GUI components
You can enhance your test by parameterizing the values that it uses. A parameter is a variable that is assigned a value from an external data source or generator.
You can parameterize values of:
-
Checkpoints.
-
Object properties for a selected step.
-
Operation arguments defined for a selected step.
-
One or more properties of an object stored in the local object or the Object Repository Window.
Example: Your application may include a form with an edit box into which the user types the user name. You may want to test whether your application reads this information and displays it correctly in a dialog box. You can insert a text checkpoint that uses the built-in environment variable for the logged-in user name, to check whether the displayed information is correct.
When you parameterize the value of an object property for a local object, you are modifying the test object description in the local object repository. Therefore, all occurrences of the specified object within the action are parameterized. For details on the local object repository, see Test objects in object repositories.
You can parameterize the values in steps or the values of action parameters using one of the following parameter types:
-
Test/action parameters. Test parameters enable you to use values passed from your test. Action parameters enable you to pass values from other actions in your test. For details, see Test and action parameters.
-
DataTable parameters. Enable you to create a data-driven test (or action) that runs several times using the data you supply. In each repetition, or iteration, UFT One uses a different value from the Data pane. For details, see Data table parameters.
-
Environment variable parameters. Enable you to use variable values from other sources during the run session. These may be values you supply, or values that UFT One generates for you based on conditions and options you choose. For details, see Environment variable parameters.
-
Random number parameters. Enable you to insert random numbers as values in your test. For example, to check how your application handles small and large ticket orders, you can instruct UFT One to generate a random number and insert it in a number of tickets edit box.
-
If you want to parameterize all the operation arguments in your test or in one or more actions of a test, consider using the Automatically parameterize steps option. For details, see Automatically parameterize steps.
-
If you want to parameterize the same value in several steps in your test, consider using the Data Driver rather than adding parameters manually. For details, see Data Driver.
Tip:
See also: