ONWEBPAGEDIALOG

From iMacros
Jump to: navigation, search

Web page dialogs are similar to Javascript dialogs except they display HTML content. Since web page dialogs can contain any number of buttons or boxes you can automate them by sending a specific list of keyboard commands to them. Web page dialogs are not normal HTML browser windows. Therefore they do not open in a separate tab, but pop up in front of the current window. The ONWEBPAGEDIALOG command must appear (in most cases) before the TAG command that triggers the popup. During replay "ONWEBPAGEDIALOG KEYS={WAIT<SP>2}{CLOSE}" is active by default to close unwanted ad dialogs.

Syntax iMacros Browser IE Plug-in

ONWEBPAGEDIALOG KEYS=some_keys|MACRO=macro_file

Firefox does not support Web Page Dialogs. They are a Microsoft specific Internet Explorer feature.

Parameters

  • KEYS
    The series of key strokes to send to the dialog. Please use <SP> to replace whitespaces and <BR> for line breaks.
    In addition to the alphanumeric keys (a-z, A-Z, 0-9 and so on) the following special keys and commands are supported (the curly brackets are mandatory):
    • {TAB}
      Enter a tabulator.
    • {ENTER}
      Hit Enter key.
    • {UP}
      Hit the Up Arrow key.
    • {DOWN}
      Hit the Down Arrow key.
    • {CLOSE}
      Close the dialog
    • {WAIT<SP>Seconds}
      Wait for Seconds seconds before proceeding with the next key stroke.
  • MACRO
    The name of a macro file to play. All of the commands in this macro are executed against the web page dialog.
    For more information about using this method see How to automate web page dialogs.

Examples

Related example macro: Demo-OnWebPageDialog

If you want to close all upcoming dialogs immediately then use

ONWEBPAGEDIALOG KEYS={CLOSE} 

Suppose a dialog comes up that asks you to enter your name and country, then use

ONWEBPAGEDIALOG KEYS=Frank<SP>Miller{TAB}USA{ENTER} 

To play a specific macro for a web page dialog use

ONWEBPAGEDIALOG MACRO=HandleWebPageDialog.iim

where HandleWebPageDialog.iim might look like the following for the example above to enter name and country:

TAG POS=1 TYPE=INPUT:TEXT ATTR=ID:NAME CONTENT=Frank<SP>Miller
TAG POS=1 TYPE=SELECT ATTR=ID:COUNTRY CONTENT=$USA

See Also

How to automate web page dialogs, ONCERTIFICATEDIALOG, ONDIALOG, ONDOWNLOAD, ONERRORDIALOG, ONLOGIN, ONSECURITYDIALOG