Clone this wiki locally
Modal dialogs (aka popups) are supported internally by Vapir for both IE and Firefox.
WinClicker is gone from Vapir.
AutoIt exists (the only thing currently using it is IE#send_keys) but is not recommended and not supported.
The Modal Dialogs API is listed here (it will be in rdoc as soon as issues with creating an rdoc for Vapir are resolved).
The API is different from Watir’s API (to such extent as API exists in Watir for this).
The #modal_dialog methods return a
Vapir::Firefox::ModalDialog object, if a modal dialog exists on the window in question.
If a bang-method is used, then the method will error if no modal dialog exists on the window in question. If a non-bang-method is used, nil will be returned in that case.
Options that may be passed (but may be omitted and a sensible default will be used) are:
:timeout=> (a number) – the number of seconds to wait for the modal dialog to come into existence.
showModalDialog. See the method
ModalDialog#document and the class
ModalDialogDocument to handle these.
Returns true if the modal dialog exists. Returns false if not.
Returns the text displayed in the modal dialog.
Not yet implemented for Vapir-Firefox
prompt(), to which this is targeted).
Finds a button on the modal dialog with text matching the given text. Clicks on it.
Closes the modal dialog.
May error if the modal dialog is not able to be closed.
Returns a ModalDialogDocument (see its documentation below).
showModalDialog. All of the container methods to access elements apply to this – it includes Vapir::PageContainer and Vapir::Container, which are documented elsewhere (or will be soon).
$ie holds your Vapir::IE instance, you might do something like
modal_dialog_document = $ie.modal_dialog.document a_div = modal_dialog_document.div(:id, 'some_div') puts a_div.text
This class is not supported in IE in Ruby 1.9.1 yet.
Here is a quick example that you can play with in an irb session: