Creating and assigning test variables
You can create a variable and initialize it to an alphanumeric value. Then, within the test, you can assign the value of the variable to a test element.
Before you begin
You must have completed the following tasks:
- Ensured that you are assigned a Team Space Owner, Project Owner, or Member with a Tester role to create or edit a test resource.
- Read and understood the information in Edit branch overview and Create or select an Edit branch.
- Ensured that your project contains a Web UI test.
- Opened the test in Test Editor. See Editing a Web UI test.
Procedure
-
Click the
button displayed on the Test
Editor page.
The Edit button appears only when no active edit branch is selected.
Alternatively, right-click the test in the test navigator panel and select Edit.
The Edit branch dialog is displayed.If the Edit branch dialog is not displayed, then go to step 3. - Select an existing branch or create a new branch.
-
Click the Configure settings and data step in Test
Editor.
The Configure settings and data pane is displayed.
-
Click Add icon
in the
Variables section.
-
Enter a name for the variable in Name.
The name must start with an alphabet, $, or _ and the name must not be a reserved keyword or contain a space.
-
Enter a value for the variable.
The newly created variable is listed in the Variables section.The default variable type is Input.
-
Optional: Click the variable icon
to change the type
to Output or Local.
-
Perform the following steps to assign a variable to a test element:
-
Click the Save icon
to save the modifications.
Results
Note:
The variables that you created in Test
Editor are listed in the Variables section of the
Configure settings and data pane as test variables.
What to do next
- Run the test in Test Editor and view the Functional Report to verify the test steps with the variable assignment. See Running a Web UI test.
- Start the test run from the Execution page, and in the Execute test asset dialog, navigate to the Configure settings and data option on the Test Editor page to view the Test variables defined in the test. See Configuring a run of a Web UI test and Variables.