You can create verification points for alert, confirm, or prompt dialogs in a
recorded Web UI test by validating text messages in the dialogs. The text messages are
validated during the playback. You can also choose to skip the step for dialogs and continue
to the next step if such dialogs do not exist.
You can select the Validate Text checkbox in the test step
of alert, confirm, or prompt dialogs of a recorded Web UI test script. After you select
this checkbox and play back the test script, the text message in the dialog is validated
before the user action. The results are captured in the unified report. You can also
select the Skip the step if the control is not found checkbox
for the test step of alert, confirm, or prompt dialogs in a recorded Web UI test
script. After you select this checkbox and play back the test script, Test UI checks for the dialog
and marks the step as Pass even if the dialog does not exist.
By skipping the step for dialogs, you can manage the optional dialogs that might or
might not display depending on user actions.
Restriction: If you run the Web UI test on an emulator, the emulator might not
display the alert dialogs. In such cases, you can run the test by using the real
Android device or select the Skip the step if the control is not
found option.
You can view the unified report to read the
message that is logged regarding the presence of the dialog.
-
Record a web application with an alert, confirm, or prompt dialog.
-
Create a duplicate of the required test step such as Accept the
Alert, Accept the Confirm, or
Enter text and Accept the Prompt in the
Test Contents pane in the generated test.
-
Select the original test step.
-
Enter the text to be verified in the Text box in the
User Action Details pane.
-
Select the Validate Text checkbox.
Depending on the selected dialog type, the test step is modified to display
one of the following statements:
- Verify that Alert text contains
dialog text
- Verify that Confirm text contains
dialog text
- Verify that Prompt text contains
dialog text
This statement ensures that the text message is validated before the
user interface action is played back in the dialog.
- Optional:
Enter the Think time value in milliseconds.
Think time is a statistical emulation of the amount of time that actual users
spend to read or think before they perform an action.
- Optional:
Select the Time out (seconds) checkbox, and then enter a
value for the timeout for the selected step.
Note: The timeout value specifies the amount of time, in
seconds, that the Test UI waits for data. If no data is received for the specified amount of time,
the session is disconnected.
- Optional:
Select the Skip the step if the control is not found
checkbox to mark the step as Pass even if the dialog does
not exist.
-
Save the test.
You can run the test and verify the results in the unified
report. See Running a Web UI test and Unified reports for Web UI, mobile, and Windows tests.