iMacros is distributed as a browser add-on for Firefox, Chrome, and Internet Explorer, besides a standalone iMacros Browser, a derivative of IE with a command line interface. (Notice that the iMacros Browser is not available in all iMacros editions. See Features Comparison.)
This article primarily covers interaction with the iMacros Browser, however, the concepts and interface are fairly consistent among all the different versions of iMacros. Throughout this Wiki, iMacros commands and functionality are associated with browser icons ( ) to designate their applicability to a particular browser.
iMacros for Internet Explorer
After installing the software, a new iMacros icon appears on the command bar of Internet Explorer (IE).
Click this icon to start iMacros.
If you have already customized your IE command bar, you might need to manually add the icon or reposition it so it's visible. Please see this relevant FAQ for more on how to do this.
You can also start iMacros for IE by selecting 'iMacros Web Automation' from the IE Tools menu. Or run the program "iMacros.Sidebar.exe".
The iMacros Browser
To start the iMacros Browser, select the program from the Start Menu, double-click the icon on your desktop, or run the program "imacros.exe".
To become familiar with iMacros run the "FillForm" demo macro that is automatically installed. This demonstrates the basic features of iMacros in a straightforward way. It navigates to a test form, fills the form and submits it, then returns to the iMacros Website.
The iMacros Graphical User Interface
We have invested a lot of effort in making the Graphical User Interface of the iMacros Browser and the iMacros for Internet Explorer as intuitive as possible. This section explains the basic elements.
The Main Window
The main window consists of three parts: the menu at the top, the iMacros sidebar on the left, and the browser window on the right. Web pages are displayed in the browser window using a tabbed interface just like other browsers. You control iMacros with the elements in the sidebar on the left.
The iMacros Sidebar
The iMacros sidebar is divided into two parts. The top half displays a tree view of all your macros when iMacros is stopped, and the current macro code when you are playing or recording a macro. Only files with a .iim or .iimx (encrypted macros) extension in the Macros folder are recognized by iMacros. The Macros folder is specified in the Path settings. The default macro folder is located in user Documents folder under iMacros\Macros.
On the lower part of the sidebar, you can find the controls for recording, playing and editing macros, as well as the controls to change general settings and to access help.
Tip: You can auto-hide the sidebar by "un-pinning" it from the main window (just click on the thumb-pin icon to pin or unpin the sidebar), or you can move the sidebar outside the main window to a "floating" position, or dock it on the right, if you prefer. You can also hide the toolbar from the View menu. The sidebar needs to be open in IE for iMacros to function.
What's a Recording Mode?
It is important to note that the primary way iMacros records your interaction with a web page is by recording your mouse clicks on the various web page elements. iMacros records these clicks as well as text entered into input fields on web forms and translates them into TAG commands. If you are entering and selecting values in a series of fields on a web form, you need to navigate to each field with the mouse and click into/on that field.
Note: Navigating through fields with the keyboard (i.e. using the TAB key) might not be recorded.
Before recording, it is important to understand the different modes of recording that you can use. The main recording modes are TAG (Automatic, Expert or Complete HTML, and Selector), EVENT, and DirectScreen. To select a mode, use the Recording Options menu item or open the Recording Options Window from the sidebar while recording.
iMacros attempts to choose the best recording options (recommended in most cases for recording on HTML websites). In the automatic mode, iMacros looks at the different attributes an element has (such as ID, NAME, Text, HREF, etc.) and selects the one attribute it thinks fits best (for details, please see the "For advanced users" description). Note that the automatic mode never switches to Expert or DirectScreen mode. If you need these recording modes, please select them manually.
Tag Expert (Complete HTML)
This mode is for advanced users: iMacros does not select just one attribute as in the automatic mode, but instead creates a TAG command that consists of all attributes of the clicked HTML element. The purpose is to give the user a quick overview of all of the element's attributes. Typically the user will use such a TAG command as a starting point, and then delete the attributes that should not be used. Often this is more convenient than building such a TAG command manually.
In this mode, a TAG command is built using the CSS Selector for the element, by default using its id. You can disable the checkbox "Prefer element ids in selectors" to force iMacros for using another attribute. Modern websites rely heavily upon CSS selectors and unique ids, so this mode will work well in such modern web pages.
- Drag & Drop
- Tricky date control
- Dynamic drop-down boxes
This is the ultimate solution if everything else fails. It simulates standard mouse clicks and movement within the browser window. This feature works with all web pages. For non-html elements such as Flash or Silverlight, you must use the DirectScreen mode. DirectScreen is not available in all iMacros Editions, see the Features Comparison for which editions support it.
In most cases, you will record your macros using just one recording mode, but you aren't limited to just one mode per macro. In fact, you can mix the modes in a single macro by changing the click mode while you are recording! This is useful if you encounter problems while attempting to record one or more elements on a web page: simply switch to a different mode and try clicking the element again.
You may also have to change recording modes if you notice that your recorded commands are not playing back successfully. In this case, try selecting a different mode and re-record your macro.
Image validation (the IMAGECLICK and IMAGESEARCH commands) combines the power of DirectScreen with computer vision. To use it, open the Image Validation Wizard. For more details please see Image Validation. Image Validation is not available in all iMacros editions, see Features Comparison.
To record a macro
To start recording a macro, select one of the following methods:
- Click the "Record" button on the iMacros sidebar
- Press Ctrl+F5.
Now simply perform whatever tasks you wish to record, such as surfing to websites, filling out forms, making a test order on your e-commerce site or any other task of your choosing.
After you have finished recording press "Stop". The current recording is automatically saved with the Default Macro Name.
Hints for successful recording
- Select elements to record by on clicking them with the mouse (don't use the TAB key to navigate through fields).
- Recording "Clicks". If a macro generates an error during replay you can experiment by selecting DirectScreen as a recording mode
- Because the iMacros recording language is fully documented it is easy to edit and "tweak" the macro manually after recording!
Related animated tutorial: Recording a macro
To play a macro, first select the macro in the macro list and then choose one of the following methods:
- Click the "Play" button or on the sidebar.
- Simply double-click the macro in the list.
- Press the F5 key.
During playback, a blue frame shows you which parts of the web page are being manipulated. To play a recorded sequence multiple times, fill in the maximum number of times to repeat the macro and press the "Play" button.
Controlling playback speed
There are two different options that affect the speed at which macros are replayed. These can be set in iMacros Settings as well as within the macro with the !PLAYBACKDELAY variable.
The delay can be set to any value in seconds, but in the settings window, the maximum is 2s. Clicking on the labels fast, slow and fast is a quick way to set the value to their fixed delays:
- FAST: the macro is replayed at maximum speed = no delay
- MEDIUM: iMacros waits for 1 second between each command
- SLOW: iMacros waits for 2 seconds between each command
The second option is to add timing information during recording (DirectScreen click-mode only). If the "Add timing information" checkbox is checked in the Recording Options window, then WAIT statements are automatically included in the macro. Thus, during a replay these WAIT statements slow down the macro playback.
Of course, you can also always manually add WAIT statements to your macro to further control the speed.
Errors during replay
We work hard to make iMacros as "intelligent" as possible, but it still is not as smart as you. If an error occurs during replay it is mostly due to a "tricky" web page in which one of the automatic suggestions of the iMacros Recorder failed. In almost all cases re-recording the macro with different settings or manually editing the macro solves the problem. For recording tips please see the Recording section and for information on how to edit your macro go to the Editing Macros section.
Related forum posts:
Tip: If you want to prevent the blue frame from being drawn around tagged elements during playback, add the following statement to your macro:
SET !MARKOBJECT NO
(Related example macro: FillForm)
All recorded macros are stored as a plain text file with the .iim extension in the folder specified by the "Folder Macros" setting on the Path tab of the Options dialog. The default macro folder is located in My Documents under iMacros\Macros.
You can manually edit and tweak the macros using any text editor you like. iMacros comes with a dedicated editor designed especially for macros.
To edit a macro, first select the macro in the macro list and then choose one of the following methods:
- Click the "Edit" button on the sidebar.
- Right-click the macro in the list and select "Edit macro".
- Press the F9 key.
By default, iMacros will use the iMacros Editor, but you can choose another one in the "External editor" setting on the Path tab of the Settings dialog. The editor will open and display the macro - in this example, we chose the FillForm demo macro:
As a simple edit step, let's change the content of a form text field now. To change the Name below from "Tom Tester" to "Dr. A. Award" locate the TAG command that contains "Tom Tester" and change is as shown below:
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:f1 ATTR=NAME:n1 CONTENT="Tom Tester"
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:f1 ATTR=NAME:n1 CONTENT="Dr. A. Award"
If the value of the CONTENT parameter contains spaces, you must either:
- Enclose the value in double-quotes
- Replace all spaces in the text with <SP> and substitute all newlines with <BR>, e.g. CONTENT=Dr.<SP>A.<SP>Award. (Related forum post).
After you save the changes to the file, iMacros will immediately apply them during the next replay of the macro.
- View some tutorials
- Learn about protecting passwords in your macros
- Learn how to handle macro errors
- Learn about using variables in your macro
- Learn how to use a simple loop with a macro
- Learn about using wildcards for page elements with dynamic attributes and content
- Learn how to handle browser dialogs
- Learn how to download files and page items, save complete pages, and take screenshots
- Learn about filling web forms
- Learn how to extract data from web pages (web scraping)
- Learn more about DirectScreen Technology
- Learn how to use Image Recognition
- Learn how to use iMacros for Web Testing
- Unleash the full power of iMacros with Web Scripting!
- Take a look at some macro and script examples