Dialog boxes are usually prompts that halts the user's navigation of a page and requests the user to take action in order for the browser to know how to proceed. Some examples of dialog boxes are listed below:
To close these dialog boxes, there is a directive available that by default will click the button that causes the user to accept the prompt. For example, in the "Security Information" dialog above, this directive will cause the 'Yes' button to be clicked. In the prompt below it, this directive will cause the 'Ok' button to be clicked.
If you know beforehand that clicking on something in the web page will cause one of these dialogs to appear, click 'Action' from the menu, and click 'Add Accept Dialog Box' and the directive 'acceptdialog' will be added to script before the step producing the dialog box occurs.
If you did not know that the dialog box would occur and have already gone too far to add 'acceptdialog', simply click inside the script text box and add 'acceptdialog' before the step that causes the dialog box to appear.
Additionally, some dialogs, such as the confirm dialog above contains titles that vary according to the current URL of the browser. To be able to click on these dialog boxes, the title must be supplied to 'acceptdialog'. This directive also takes another optional parameter that specifies the amount of time it takes for this dialog box to appear. The default timeout is 5 seconds but pages with performance problems may take longer to show this dialog box.
For example, if the confirm dialog box above took more than 5 seconds to appear, the following usage of the directive will allow this dialog box to be closed:
acceptdialog(10, "The page at http://www2.webmetrics.com says:")
This example gives the dialog box with the title "The page at http://www2.webmetrics.com says:" 10 seconds to appear.