FindModalHtmlDialog - web automation method

Connects a Frame IE automation object to a modal dialog box that displays a HTML document (see showModalDialog).

Applies to:
  var modalFrame = browser.FindModalHtmlDialog();
The method returns a Frame IE automation object corresponding to a HTML modal dialog box created by showModalDialog method. If no modal HTML dialog box is found, then null is returned. Internet Explorer pop-up blocker may block HTML dialogs. In case of an error the method throws a script exception and the lastError property of the core object is set as follows:
The time allocated for search is specified by the searchTimeout property. If loadTimeout is not zero, then the method waits the browser objects to be completely loaded in the amount of time specified by the property. If the timeout has expired the lastError property is set to LOAD_TIMEOUT_ERROR. In this case, if loadTimeoutIsError property is true, then a IE macro exception is thrown.
var coreObj = new ActiveXObject("Twebst.Core");
var browser = coreObj.StartBrowser("");
var openBtn = browser.FindElement("input button", "text=Open Modal Box");

// Click the button that opens the modal dialog.


var modalFrame = browser.FindModalHtmlDialog();


// Click the button that closes the modal dialog.
var closeBtn = modalFrame.FindElement("input button");
See also:
Browser | Frame | FindChildFrame | FindFrame | FindModelessHtmlDialog | searchTimeout

© 2014 CodeCentrix Software. All rights reserved.