In case the same kind of processing appears in multiple test cases, by defining such processing as “shared steps,” it can also be used in other test cases. If it is necessary to make modifications to the processing content, only one shared step needs to be rewritten, which reduces the time and effort required for test case maintenance.
Creating shared steps
Choose “Create shared step” from the Edit test case screen (Figure 1), select the command you want to make into a shared step, and click “Complete” (Figure 2).
Figure 1 Creating shared steps
Figure 2 Selecting a command
When you click the “Complete” button, an error message stating “Line*: The UI must be a shared UI to use this as a shared step” may be displayed. UI that can be used within shared steps need to be “shared UI” that can be used in all project tests, so drag and drop the UI at the line for which an error appeared in Figure 3 to make it a shared UI.
Figure 3 Sharing UI
After you make all required UIs into shared UIs and click the “Complete” button again, the dialog box to create the shared step will be displayed. If you input the “Shared step name” in this dialog box and click “Create,” the processing content shall become a shared step, as shown in Figure 4.
Figure 4 Created shared step
Using shared steps
After creating the shared step, reload the Edit test case screen. Once done, you will be able to select the shared step created in the command selection pop-up window, as shown in Figure 5.
Figure 5 Using shared steps
Editing shared steps
For test cases using shared steps, click the “Edit shared steps” button (Figure 6), and click "Shared Step" > “Edit” (Figure 7) on the project page.
Figure 6 “Edit shared steps” button
Figure 7 “Shared steps” on the project page
Then, you will be taken to the Edit shared steps screen, as shown in Figure 8.
Figure 8 Edit shared steps screen
Although you can correct the content of shared steps on the edit screen, you cannot upload a screen capture.
Shared step variables
When using shared steps, there may be times when you want to specify parameters externally when calling. For example, in case of the “Register test user” step above, you may want to call this step by specifying different usernames for each test.
In such a case, you can use the shared step “variable” function.
To specify this variable, first connect the input column and variable definition list for the command in the Shared step creation popup window (Figure 9). Note that you cannot connect to a value input column without a connect button.
Figure 9 Connecting to the value input column and variable definition list
Once you connect, specify the appropriate “variable name” corresponding to the value as shown in Figure 10. The "Variable value" is the value that is initially set when the shared step is used, and this can be left blank.
Figure 10 Specifying the variable name
The common steps created this way can specify the value of the variable based on the test cases used, as shown in Figure 11.
Figure 11 Specifying the shared step variables in the test case
If you need to modify the contents of a variable after creating a shared step, you can do so on the Edit shared steps screen, as shown in Figure 12.
Figure 12 Editing variables from the Edit shared steps screen
Shared step variables can use UI elements as well as input strings. You can use this, for example, if you want to tap all of the screen menus in order, to check transitions. As in the case of a value input column, connect the UI element and variable and give the variable an appropriate name. You can connect to one variable with either a string or a UI element, but not both.
Figure 13 Setting UI elements as shared step variables
If you want to associate a separate UI element in the test case, drop the element in the parameter name section.
Figure 14 Linking separate UI elements