Testing for the presence of jQuery UI modal dialog or alternative on page Testing for the presence of jQuery UI modal dialog or alternative on page selenium selenium

Testing for the presence of jQuery UI modal dialog or alternative on page


I've worked on something similar in the past.

Assuming the modal is contained in a div, I'd start with a 'WaitForVisible' on that to wait until the modal is acutally showing.Then you can interact with the elements in the normal way, and then have a 'WaitForNotVisible' once you've finished with it.

If there isn't a convenient containing div, just pick some other element on the modal to wait for.


The following works with the demo JQuery UI modal dialog at http://jqueryui.com/demos/dialog/

open | http://jqueryui.com/demos/dialog/click | css=#demo-config-menu a:contains(Modal dialog)waitForVisible | dialog-modalassertText | ui-dialog-title-dialog-modal | Basic modal dialogassertText | dialog-modal | Adding the modal overlay screen makes the dialog look more prominent because it dims out the page content.click | css=.ui-dialog-titlebar-closewaitForNotVisible | dialog-modal


<tr><td>waitForTextPresent</td>  <td>Selecione os produtos para impressão</td><td></td>

You can use this to check dialog by the title