FindModalHtmlDialog - web automation method

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

Applies to:
Browser
  var modalFrame = browser.FindModalHtmlDialog();
Arguments:
None.
Remarks:
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.
Example:
var coreObj = new ActiveXObject("OpenTwebst.Core");
var browser = coreObj.StartBrowser("http://www.codecentrix.com/tests/htmdlg.htm");
var openBtn = browser.FindElement("input button", "text=Open Modal Box");

// Click the button that opens the modal dialog.

openBtn.Click();

var modalFrame = browser.FindModalHtmlDialog();

WScript.Sleep(2000);

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

© 2017 CodeCentrix Software. All rights reserved.