This topic describes how you can use the
Test Logic Designer to add verification logic to a visual test. Any type of verification logic sends a user-defined pass/fail message and a flag
(optional) to the result of your visual test.
-
Open the visual test.
-
Right-click on the test step which includes the object that you want to verify.
-
Choose
.
The
Test Logic Designer wizard opens.
-
Click
Next.
-
From the
Select a Logic Type page, select the type of verification logic.
Select a type of verification logic based on:
- The property of a control – Creates verification logic based on the value of a property of a control. For example:
Verify "Button"."Text" Is Equal to "Cancel"
- Whether a control exists - Creates verification logic that checks if the specified control exists or if the specified control does not exist. For
example:
Verify "Button" Exists Is Equal to True
-
A variable defined in this visual test – Creates verification logic based on the contents of a local variable in your visual test. For example:
Verify st_LastValidation Is Equal to False
- The contents of a Rumba screen - Creates verification logic to compare the contents of a
Rumba screen.
- A verification asset - Creates verification logic to compare the contents of the UI against an asset. Currently,
Silk Test Workbench supports only image verifications as verification assets. For additional information, see
Asset Types. For example:
Run the Image Verification called 'Untitled_1'
- The time taken to run a sequence of steps - Creates verification logic based on the time taken to run a sequence of steps. For example:
Verify timer number '1' is between 0 and 2 seconds Do Step 3 To Step 4
-
Click
Next.
-
If you have selected
The property of a control, the
Define a property-based condition page opens.
-
Expand the
Identify a control menu and select one of the following:
- Application Under Test – Click this button to identify a visible control directly from the application under test.
- Screen Preview – Click this button to identify a control directly from the
Screen Preview, if the application under test is not available.
- Identify Object Dialog – Click this button to use the
Identify Object dialog box to identify a non-visible control. The
Identify Object dialog box additionally enables you to edit the locator of the control.
-
Additionally, you can also type the full locator of the control into the
Name of control field and click
Refresh.
If the control is found in the application under test, the
Select a property is populated with the properties of the control.
-
In the
Select a property table, select the property.
-
From the
Select the condition list, select the conditional logic to apply to the property of the control.
-
In the
Expected value field, specify the value that the property is expected to have.
-
Click
Next.
-
If you have selected
Whether a control exists, the
Define an exists condition for the control page opens.
-
Expand the
Identify a control menu and select one of the following:
- Application Under Test – Click this button to identify a visible control directly from the application under test.
- Screen Preview – Click this button to identify a control directly from the
Screen Preview, if the application under test is not available.
- Identify Object Dialog – Click this button to use the
Identify Object dialog box to identify a non-visible control. The
Identify Object dialog box additionally enables you to edit the locator of the control.
-
Select
Control exists to verify that the control exists.
-
Select
Control does not exist to verify that the control does not exist.
-
Type a value into the
Timeout field to specify how long
Silk Test Workbench should wait for the control to appear or to disappear.
The default timeout is 0, which means
Silk Test Workbench does not wait for the control to appear or to disappear.
-
Click
Next.
-
If you have selected
A variable defined in this visual test, the
Define a variable-based condition page opens.
-
Select a pre-defined local variable from the
Select the variable list.
For a variable to appear in this list, you must include the local variable in your visual test. To add a new local variable
to the visual test, click
New.
The
Evaluate as field, displays the data type of the selected variable.
-
Select the comparison operator to apply to the variable from the
Select the condition list.
-
In the
Expected value field, specify the value that the variable is expected to have.
-
Click
Next.
-
If you have selected
The contents of a Rumba screen, identify the control on the
Rumba screen.
-
Expand the
Identify a control menu and select one of the following:
- Application Under Test – Click this button to identify a visible control directly from the application under test.
- Screen Preview – Click this button to identify a control directly from the
Screen Preview, if the application under test is not available.
- Identify Object Dialog – Click this button to use the
Identify Object dialog box to identify a non-visible control. The
Identify Object dialog box additionally enables you to edit the locator of the control.
-
Click
Next.
-
If you have selected
A verification asset, the
Build the Verification Asset page opens.
-
Click
Create a new verification to open the
Image Verification UI, in which you can create a new verification asset.
-
Click
Insert an existing verification to open the
Browse for Verification dialog box, in which you can choose the verification asset that you want to execute in your test.
-
Optional: Check the
If the verification fails, capture a screenshot check box to add a screenshot to the result file when the verification fails.
-
Click
Next.
-
If you have selected
The time taken to run a sequence of steps, the
Define a timing-based condition page opens. Specify the sequence of test steps and the range of time within to play back the sequence of test steps.
-
Click on the link to the right of the
Do step statement to specify the first step in the sequence of steps to verify.
-
Click on the link to the right of the
To step statement to specify the last step in the sequence of steps to verify.
-
By adapting the values in the two
Should be between fields, sets the range of time in which the sequence of steps should play back.
For example, if the range of time is set to 10 to 30 seconds and the actual time to play back a specified sequence of steps
is less than 10 seconds or greater than 30 seconds, then a fail message is sent to the result of the visual test. Conversely,
if the actual playback time falls between 10 and 30 seconds, then a pass message is sent to the result of the visual test.
-
Select a timer from the
Using timer number list.
When timing multiple conditions, you can differentiate the timers by assigning a unique number to each timer. After creating
verification logic using a timer, two test steps appear in the
Test Steps window. The first is labeled
Start timer number X (with
X being the specific timer number) and appears just before the first test step in the sequence of steps to verify. The second
is labeled
Stop timer X and appears just after the last step in the sequence of steps to verify.
Tip: If you want to change the sequence of steps to verify, cut and paste either timer test step to the desired location in the
Test Steps window.
-
Click
Next.
-
The
Build the Verification page opens. Create pass/fail messages to include in the result of your visual test. Additionally, if the verification fails,
you can send a flag to the result and the
Start Screen of the current user.
-
Optional: Click on the condition link to the right of the
If statement to open the
Condition Designer from which you can edit the condition.
-
Type text into the
Display the following pass text in the result detail field that should appear in the result when the verification passes during playback.
The text appears in the
Result Detail column of the verification step in the
Test Steps pane of the
Details tab.
-
Type text into the
Otherwise display the following fail text in the result detail field that should appear in the result when the verification fails during playback.
The text appears in the
Result Detail column of the verification step in the
Test Steps pane of the
Failed tab,
Flags tab, and
Details tab.
-
Optional: Check the
If the verification fails, create a flag in the result check box to create a flag when the verification fails.
The flag appears in the
Result Detail column of the verification step in the
Test Steps pane of the
Failed tab,
Flags tab, and
Details tab. By default, this flag is automatically assigned to the current user and displays in the
Flags pane of the
Start Screen of the current user. If you want to assign this flag to someone else, you must reassign it after playback from the result.
-
Optional: Type a description of the flag when the verification fails into the
Display the following flag description field.
-
Optional: Check the
If the verification fails, capture a screenshot check box to add a screenshot to the result file when the verification fails.
-
Click
Next.
The
Summary page displays the test logic that you have defined. Uncheck the check box at the bottom of the page to prevent the
Summary page from appearing on subsequent uses of the
Test Logic Designer wizard. Checking or un-checking this check box updates the
Show Test Logic Designer summary screen general option. For more information, see
Modifying General Options.
-
Click
Finish to insert the test logic into the test steps of your visual test. To modify the test logic, click
Back and make the desired changes.
The test logic is added to the visual test.