Your SlideShare is downloading. ×
  • Like
Advanced Web Browser Automation
Upcoming SlideShare
Loading in...5

Thanks for flagging this SlideShare!

Oops! An error has occurred.


Now you can save presentations on your phone or tablet

Available for both IPhone and Android

Text the download link to your phone

Standard text messaging rates apply

Advanced Web Browser Automation


Advanced Web Browser Automation

Advanced Web Browser Automation

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads


Total Views
On SlideShare
From Embeds
Number of Embeds



Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

    No notes for slide


  • 1. Advanced Commands
  • 2. Advanced Commands
    • After visually recording the main parts of the macro, enhance and fine-tune the macro by editing it.
    • All macros are simple text files
    • File structure and commands fully documented
  • 3. Macro in a Notepad File:
  • 4.
    • The recorded macro is stored in an easy to read text file (file ending: ".iim") which can be easily edited.
    • To edit a macro go to edit tab present on the left hand side of the browser, next to play and record and press edit macro button.
    • The default editor for editing Internet Macros is "Windows Notepad" (notepad.exe).
    • You can use another editor by changing the default editor in EDIT tab > click OPTIONS > PATHS tab.
    • If the macro has the name “mymacro", the corresponding text file is called “mymacro.iim".
    Editing Macros:
  • 5. Editing Macros Screenshot:
  • 6. TOP 5 reasons to edit a macro
    • Edit typos made during recording
    • Insert Variables
    • Insert tags for response time measurements
    • Replace Session IDs with “*”
    • Copy & Paste several macros together or split macros in parts.
  • 7.
    • The link of some web sites change each time you visit them. This is because they create links with a "session id" which is different each time you log in.
    • Solution 1: Try a different ClickMode
    • Solution 2: Edit the macro manually after you recorded it and replace the ID (or any other changing part of the string) with "*".
    • Example: The command line:
      • ATTR=HREF:;$sessionid$tzut78ZUZTIU67$&%
    • can be written as:
    • TAG POS=1 TYPE=AREA ATTR=HREF: *index.jhtml*
    Session IDs
  • 8.
    • Built-in variables
      • These variables are used to define certain properties of the macro behavior
      • For example the macro timeout value SET !TIMEOUT 33.
    • User-defined Variables
      • These variables are created at run time by the command line &quot;-var_MYVAR <value>&quot;.
      • For Example -var_ITEM 15 creates the variable {{ITEM}} and gives it the value 15.
      • These variables can be part of ANYTHING inside the macro.
      • In addition to routine tasks of opening and saving web pages, macros can be used for more complicated tasks. For example, extracting data from one website and inserting it into another.
    Two kinds of Variables:
  • 9. Built-in Variables
    • SET !TIMEOUT 33
      • Defines new timeout value
      • Tells IM to ignore errors and continue
    • SET !FILELOG c:mylog.txt
      • Sets a specific log file name for the current macro
      • Contains the current page URL
      • {{…}} are used when the value of the variable is used
    • See user manual for a list of all built-in variables
  • 10. Getting Data to a website
  • 11.
    • You can submit different information to the same Web page using Internet Macro.
    • The data source can be in two different formats:
      • Either a text file with a list of variables and their values (“ini file style”)
      • A comma separated text file (CSV format) which can be generated by Microsoft Excel and many other applications.
      • The “List of variables&quot; format is recommend if you have many different variables (for example detailed address data or test of one user).
      • The CSV format is most appropriate for use with a few variables with many different values (for example a long list of user accounts that you want to submit to a website).
    • You can link to any CSV or List of variable file by using the statement in the macro:
        • CMDLINE !DATASOURCE mydata.txt
    Submitting Data to Websites:
  • 12.
    • A CSV file looks like this:
      • “ FIRST NAME&quot; , “LAST NAME&quot; , “AGE“
      • “ Andrew&quot;, “Smith&quot;, “23&quot;
      • “ John”, “Rafols”, “39”
      • “ Ann”, “Schwarz”, “30”
      • Variables in the macro: {{!COL1}}, {{!COL2}}, {{!COL3}}
    • A “List of variables“ file looks like this:
      • [iOpus]
      • FirstName=Andrew
      • LastName=Smith
      • Age=23
      • Variables in the macro: {{FirstName}}, {{LastName}}, {{Age}}
    CSV and Variable Files
  • 13. Demo: Submit Data to Website
    • Take a list of ISBN numbers from a file and search for them at
      • 0970436300
      • 0471430218
      • 0471201006
      • 0471232815
      • 0131421891
    • Take a list of keywords and search for them on
  • 14. Getting Data from web pages
  • 15. Getting data from the Web Page
    • Save web page
    • Downloading file
    • PRINT
    • EXTRACT command
    • More specialized commands:
      • “ Save Target As”, “Save Picture As” Events
    In general, getting data from websites is more complicated than submitting data, as there any many forms in which the data is made available. Internet Macros offers commands for each situation:
  • 16. Web Data Extraction TAG…. EXTRACT=…
  • 17.
    • Internet Macros can extract data from Web sites.
    • Open the site of your interest and start recording.
    • Click on the EXTRACT DATA button while in recording mode to bring up the extraction wizard.
    • The EXTRACT button is only available in the
      • iMacros Browser but not in the IE Plug-In.
    Extracting Data:
  • 18.
    • Open the Extraction Wizard.
    • In the browser window select the text that you want to extract.
    • Click the &quot;Suggest&quot; Button.
    • Click TEST to test run the extraction.
    • If you are satisfied with the result, click ADD to add the EXTRACT statement to the macro.
    • If you extract a complete table, the table data is automatically converted into comma-separated data
    Defining which Data to Extract:
  • 19. Data Extraction Wizard
  • 20.
    • There are three ways to save extracted data:
    • Built-in SAVEAS feature:
      • You can use the SAVEAS TYPE=EXTRACT command inside a macro.
      • If several EXTRACT commands are used within one macro, the content is appended to the file.
    • Reuse in macro using the {{!EXTRACT}} variable
    • Saving the data via the Internet Macros Scripting Interface :
      • When you run the macro from a script you can return the data to the script and save it with whatever method or format you prefer.
      • For example, you can save it to a text file or even directly to a database.
    How to Store Extracted Information
  • 21. Demo: Extract Data from Website
    • Create a price comparison engine: Take a list of ISBN numbers from a file and search for them at Then save them in a CSV file with two columns (1st column: ISBN number, 2nd column: Price in US$)
      • 0970436300
      • 0471430218
      • 0471201006
      • 0471232815
      • 0131421891