Recording dialogs is an out-of-the-box feature in Test Studio. The steps recorded for the dialogs provide various properties to fine tune the execution. The steps to handle dialogs can be added also manually in the test.
In this article you can find useful information about:
- Add manually a step to handle dialog
- Dialog steps timeouts
- Choose button to handle the dialog box
- File location for download and upload dialogs
Even if you work on the tests in the project and have no active recording session, you can still add the specific steps to handle a dialog from the Step Builder. All dialog steps are listed under the General section of the Step Builder, under Dialogs. Select the type of dialog to handle and add hit the Add Step button.
The various properties allows you to fine tune the steps to handle dialogs across the automated page.
The properties common for all dialogs are the HandleTimeout - controls the time, which the test waits for the dialog to be handled, and the InitializationTime - controls the time, which the test waits before it starts searching for such dialog. It is useful to increase these when it takes longer time for the dialog to appear, or to be finished (usually for the handle download dialogs, when the file to download is too large).
Each dialog step gives the option to change the button used to handle it during recording, or to adjust it if added manually.
The dropdown list provides all possible options for a button to handle a dialog. If you choose wrong type of button for the specific step, there is a prompt message to inform you which are the possible dismiss options for this dialog.
The DownloadPath and FileUploadPath properties are mandatory for the respective type dialog. They require a valid full path to the file to interact with.
You cannot directly use the Windows shortcut locations on the disc like Desktop or Documents. If you record the test using any of these locations, the path is fetched as Downloads/fileName.*, but this is not a valid file path to use and the test fails upon execution.
To use any of these reserved folders, you need to use their complete paths like C:\Users\<userName>\Desktop_ or C:\Users\<userName>\Documents.
The FileUploadPath accepts multiple files listed quoted and space separated. These will be uploaded if the server accepts multiple files upload.