Demo-FillForm Using Events

From iMacros
Jump to navigation Jump to search

This macro shows how to select and fill form elements using the EVENT command.

VERSION BUILD=11.5.497.9113
TAB T=1
TAB CLOSEALLOTHERS
URL GOTO=https://demo.imacros.net/Automate/TestForm1
'Macro that uses Events mode while recording
EVENT TYPE=CLICK SELECTOR="#name" BUTTON=0
EVENTS TYPE=KEYPRESS SELECTOR="#name" CHARS="iMacros user"
EVENT TYPE=CLICK SELECTOR="#food" BUTTON=0
EVENT TYPE=CLICK SELECTOR="#food>OPTION:nth-of-type(3)" BUTTON=0
EVENT TYPE=CLICK SELECTOR="#drink" BUTTON=0
EVENT TYPE=CLICK SELECTOR="#drink>OPTION:nth-of-type(2)" BUTTON=0
EVENT TYPE=CLICK SELECTOR="#medium" BUTTON=0
EVENT TYPE=CLICK SELECTOR="#dessert>OPTION:nth-of-type(2)" BUTTON=0
EVENT TYPE=CLICK SELECTOR="#demo>FIELDSET>OL>LI:nth-of-type(6)>INPUT" BUTTON=0
SET !ENCRYPTION NO
EVENT TYPE=CLICK SELECTOR="#demo>FIELDSET>OL>LI:nth-of-type(6)>INPUT:nth-of-type(2)" BUTTON=0
EVENTS TYPE=KEYPRESS SELECTOR="#demo>FIELDSET>OL>LI:nth-of-type(6)>INPUT:nth-of-type(2)" CHARS="Test"
EVENT TYPE=CLICK SELECTOR="#demo>FIELDSET>OL>LI:nth-of-type(7)>TEXTAREA" BUTTON=0
EVENTS TYPE=KEYPRESS SELECTOR="#demo>FIELDSET>OL>LI:nth-of-type(7)>TEXTAREA" CHARS="Order placed"
EVENT TYPE=CLICK SELECTOR="#demo>FIELDSET:nth-of-type(2)>BUTTON" BUTTON=0