ClosePrompt - web automation method

Closes a window.prompt popup window in Internet Explorer instance represented by the Browser web automation library object.

Applies to:
Browser
  var text = browserObj.ClosePrompt("popup_text", "value", "button");
Arguments:
Remarks:
If popup_text parameter is emtpy then any window.prompt popup window will be closed. This web automation method returns the text displayed by the pop-up window. The time allocated for searching the popup is specified by the searchTimeout property. The method throws a web macro exception if the popup or the button is not found. In this case the lastError property of the Core object is set to FAIL_ERROR.
Example:
var core    = new ActiveXObject("OpenTwebst.Core");
var browser = core.StartBrowser("http://www.codecentrix.com/tests/testPopups.htm");

// Use hardware events otherwise Click will be blocked until the popup is close!

core.useHardwareInputEvents = true;
browser.FindElement("input button", "text=Prompt").Click();
browser.ClosePopup("Prompt text", "new value", "OK");
		
See also:
asyncHtmlEvents | Browser | Close | closeBrowserPopups | ClosePopup | FindModalHtmlDialog | FindModelessHtmlDialog

© 2017 CodeCentrix Software. All rights reserved.