Pages

Javascript importanrt iMacros commands

I used JavaScript to have a controlled run of multiple macros. It's easy to control the order and flow of the data in iMacros using JavaScript, just basics will do. The few commands you need to know are,

  iimDisplay:-  Displays a short message in the iMacros browser.
This display the message like shown in the image within the imacro sidebar of firefox.
Syntax:
iimDisplay("Hello");

  iimSet():- Defines variables for use inside the macro and assigns values to them.
Syntax:
j=112332423;
iimSet("numeber",j); //it assigns the value of "j" to "number"

To use this variable in the macro enter it as {{number}} like,
TAG POS=1 TYPE=INPUT:TEXT FORM=ID:register_form ATTR=ID:cust_number CONTENT={{number}}

iimPlay:- Plays a macro. 
Syntax:
iimPlay("Demo-fill-form.iim");

iMacros - Why it is easy

iMacros is a browser automation tool, which comes for free in both Chrome and Firefox. This comes with record and replay functionality and this is considered as one of the best form filling automation extension. And if you know JavaScript you can do many more functionality combining iMacros with java script.
This is a very easy to use addon for browser. You just record whatever you want to do and replay it again, if you want you can even loop through the macro..

Pros:

  • User-friendly, does the work in few clicks.
  • Does not require any coding knowledge.
  • Few tasks can be accomplished just by using few added lines which you always get from the wiki.
  • It supports almost all scripting languages.

Cons:

  • Cannot do complex testing using this addon.
  • Coding knowledge is required to accomplish bigger tasks to have more easy control

How it is done...
Record:

  • Click Record button and start doing the events.
  • After recording all the events click stop, it will be saved in the name "#Current.iim" (.iim is the imacro file extension)

Play and Loop:

  • Play the macro by clicking on the Play button to replay the macro. 
  • For running as the loop, enter the max loop value and click Loop.


For more info http://wiki.imacros.net/
Tutorials click here