SlideShare a Scribd company logo
Advanced Commands
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
Macro in a Notepad File:
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:
Editing Macros Screenshot:
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.
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: TAG POS=1 TYPE=AREA ATTR=HREF: https://overture.com/s/index.jhtml;$sessionid$tzut78ZUZTIU67$&%  can be written as:  TAG POS=1 TYPE=AREA ATTR=HREF: *index.jhtml* Session IDs
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:
Built-in Variables SET !TIMEOUT 33  Defines new timeout value SET !ERRORCONTINUE (YES/NO)  Tells IM to ignore errors and continue SET !REPLAYSPEED (FAST/MEDIUM/SLOW) SET !FILELOG c:\mylog.txt Sets a specific log file name for the current macro SET !EXTRACTADD {{!URLCURRENT}} 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
Getting Data  to  a website
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:
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
Demo: Submit Data to Website Take a list of ISBN numbers from a file and search for them at Amazon.com 0970436300  0471430218  0471201006  0471232815  0131421891  Take a list of keywords and search for them on Google.com
Getting Data  from  web pages
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:
Web Data Extraction TAG…. EXTRACT=…
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:
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:
Data Extraction Wizard
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
Demo: Extract Data from Website Create a price comparison engine: Take a list of ISBN numbers from a file and search for them at Amazon.com. Then save them in a CSV file with two columns (1st column: ISBN number, 2nd column: Price in US$) 0970436300  0471430218  0471201006  0471232815  0131421891

More Related Content

PPT
iMacros Web Testing
PPT
Web Browser Scripting
PPT
iOpus iMacros Introduction
PPS
I Macros--Megha tested
PPTX
Google chrome silent install
PPTX
Silent install Adobe Reader DC
PDF
Automation Anywhere Examples
PDF
359555069 aae-control room-usermanual
iMacros Web Testing
Web Browser Scripting
iOpus iMacros Introduction
I Macros--Megha tested
Google chrome silent install
Silent install Adobe Reader DC
Automation Anywhere Examples
359555069 aae-control room-usermanual

Viewers also liked (12)

PPT
Internet Tutorial 01
 
PPTX
Research on Web Browsers ppt
PPSX
Web browser(pp ts)
PPTX
Web browsers
PDF
Web server
PPTX
Web servers
PPT
Chapter 4 Using a Web Browser
PPTX
Presentation about servers
PPTX
Basic Server PPT (THDC)
PPTX
Types of Servers - Basic Differences
PPT
Web Servers (ppt)
Internet Tutorial 01
 
Research on Web Browsers ppt
Web browser(pp ts)
Web browsers
Web server
Web servers
Chapter 4 Using a Web Browser
Presentation about servers
Basic Server PPT (THDC)
Types of Servers - Basic Differences
Web Servers (ppt)
Ad

Similar to Advanced Web Browser Automation (20)

PPT
PDF
Getting started with CATIA V5 Macros
PDF
0403-excel-macros-made-easy.pdf
PDF
Automation Anywhere Training Deck
PDF
Automation macro recorder_ a_task_automation_tool
PPTX
VBA
PPT
Excel 2007 Unit I
PDF
Ug recording excelmacros
PPTX
Scripting as a Second Language
PPTX
Recordingandrunningmacrosintheofficeapplication3
PPTX
Recording and running macros in the office application
PPTX
Web-IT Support and Consulting - dBase exports
PDF
Web-IT Support and Consulting - bulk dBase (DBF) exports via Microsoft Excel ...
PPTX
Working with Excel Macros
PPTX
Introduction to Command Line & Batch files
PDF
Getting started with Microsoft Excel Macros
PPTX
E learning excel vba programming lesson 5
PPT
WinAutomation Features
PDF
I macros manual
PDF
Os and network activity javier guerrero
Getting started with CATIA V5 Macros
0403-excel-macros-made-easy.pdf
Automation Anywhere Training Deck
Automation macro recorder_ a_task_automation_tool
VBA
Excel 2007 Unit I
Ug recording excelmacros
Scripting as a Second Language
Recordingandrunningmacrosintheofficeapplication3
Recording and running macros in the office application
Web-IT Support and Consulting - dBase exports
Web-IT Support and Consulting - bulk dBase (DBF) exports via Microsoft Excel ...
Working with Excel Macros
Introduction to Command Line & Batch files
Getting started with Microsoft Excel Macros
E learning excel vba programming lesson 5
WinAutomation Features
I macros manual
Os and network activity javier guerrero
Ad

Recently uploaded (20)

PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
gpt5_lecture_notes_comprehensive_20250812015547.pdf
PDF
A comparative analysis of optical character recognition models for extracting...
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
MIND Revenue Release Quarter 2 2025 Press Release
PDF
Approach and Philosophy of On baking technology
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
sap open course for s4hana steps from ECC to s4
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
A Presentation on Artificial Intelligence
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
cuic standard and advanced reporting.pdf
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Chapter 3 Spatial Domain Image Processing.pdf
20250228 LYD VKU AI Blended-Learning.pptx
Per capita expenditure prediction using model stacking based on satellite ima...
Assigned Numbers - 2025 - Bluetooth® Document
gpt5_lecture_notes_comprehensive_20250812015547.pdf
A comparative analysis of optical character recognition models for extracting...
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
MIND Revenue Release Quarter 2 2025 Press Release
Approach and Philosophy of On baking technology
Diabetes mellitus diagnosis method based random forest with bat algorithm
sap open course for s4hana steps from ECC to s4
The Rise and Fall of 3GPP – Time for a Sabbatical?
NewMind AI Weekly Chronicles - August'25-Week II
Network Security Unit 5.pdf for BCA BBA.
A Presentation on Artificial Intelligence
Programs and apps: productivity, graphics, security and other tools
cuic standard and advanced reporting.pdf
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Chapter 3 Spatial Domain Image Processing.pdf

Advanced Web Browser Automation

  • 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: &quot;.iim&quot;) 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 &quot;Windows Notepad&quot; (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&quot;, the corresponding text file is called “mymacro.iim&quot;. Editing Macros:
  • 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 &quot;session id&quot; 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 &quot;*&quot;. Example: The command line: TAG POS=1 TYPE=AREA ATTR=HREF: https://overture.com/s/index.jhtml;$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 SET !ERRORCONTINUE (YES/NO) Tells IM to ignore errors and continue SET !REPLAYSPEED (FAST/MEDIUM/SLOW) SET !FILELOG c:\mylog.txt Sets a specific log file name for the current macro SET !EXTRACTADD {{!URLCURRENT}} 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 Amazon.com 0970436300 0471430218 0471201006 0471232815 0131421891 Take a list of keywords and search for them on Google.com
  • 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:
  • 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 Amazon.com. Then save them in a CSV file with two columns (1st column: ISBN number, 2nd column: Price in US$) 0970436300 0471430218 0471201006 0471232815 0131421891