Web Browser Scripting

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    Favorites, Groups & Events

    Web Browser Scripting - Presentation Transcript

    1. Automated Web Testing Command-Line & Scripting Interface
    2. Command Line Interface
      • Typical uses:
      • Use macro with batch file
      • Integrate with Windows task scheduler
      • Integrate with thousands of other software packages
      • Commands:
      • Start the macro: -macro <macroname>
      • Send values to macro: -var_myvar <x>
      • Repeat macro: -loop <x>
      • Keep IM Browser open: -noexit
      • Run in background: -tray / -silent
      • Example: –macro test –var_myvar Hello[SP]World
    3. Command Line Interface (cont’d) Take values from the command line: CMDLINE !VAR1 http://www.iOpus.com/iim Check on the return value: The Internet Macros executable &quot;imacros.exe&quot; set the predefined batch file variable &quot; %ERRORLEVEL% &quot;. The value is either 1 if the macro was completed successfully or negative if an error was encountered.
    4. Example Batch File
      • &quot;C:IIMimacros.exe&quot; -macro Demo-FillForm -loop 3
      • if %errorlevel% == 1 goto ok
      • if NOT %errorlevel% == 1 goto error
      • :ok
      • echo Macro completed succesfully!
      • goto end
      • :error
      • echo Error encountered during replay.
      • echo Errorcode=%errorlevel%
      • :end
      • The batch variable %errorlevel% is set by &quot;imacros.exe&quot; upon exit
    5. Demo Project
      • Set up a test macro that runs once a day and saves the CNN.com home page to a file:
      The task scheduler can be accessed via the Windows Control Panel
    6. Scripting Interface
      • Why use the Scripting Interface?
      • Works with any Windows Scripting or programming language
      • Simple but powerful set of commands
      • Detailed error handling
      • Windows OS includes Windows Scripting Host (WSH)
      • Easy database access
    7. The six most important commands:
      • set iim1= CreateObject (“iMacros&quot;)
      • i = iim1. iimInit (“”)
      • i = iim1. iimDisplay (&quot;This is a test&quot;)
      • i = iim1. iimSet (&quot;-var_name1&quot;, &quot;Tom Tester&quot;)
      • i = iim1. iimPlay (“Test1&quot;)
      • If i > 0 Then s = &quot;Everything OK”
      • Else s = iim1. iimGetLastError ()
      • MsgBox s
      • i = iim1. iimExit
    8. Error Return Codes All functions return a value > 0 if they succeed, and an error code < 0 in case of problems. Error codes below -100 are error codes generated during the macro replay. Same code as when macro is run manually. -1 Macro timeout (Macro takes too long to run) -2 IIM Interface timeout (IM browser does not respond) -3 User pressed STOP button -4 Communication error (should not happen) -5 Browser closed (User pressed EXIT button)
    9. VB6 with Intellisense Support In order to enable Intellisense support, you need to add the „IInternetMacros“ component to your project („Early binding“). The alternative is to use CreateObject („Late Binding“, no Intellisense support) Intellisense in action… Add iMacros COM object
    10. Demo Projects
      • Performance Monitoring
        • Create response time measurement macro, and return the data to your script for further processing. Use {{!STOPWATCHTIME}} to return the measured time.
        • Use a script to alert you when response time is above threshold
      • Create Google News Extractor:
        • Submit keyword search to Google News
        • Extract headlines from returned search results
        • Store headlines in text file
        • Click NEXT link until all results are extracted

    + iopusiopus, 2 years ago

    custom

    1777 views, 0 favs, 0 embeds more stats

    The Scripting Interface of the iMacros Scripting Ed more

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 1777
      • 1777 on SlideShare
      • 0 from embeds
    • Comments 0
    • Favorites 0
    • Downloads 27
    Most viewed embeds

    more

    All embeds

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories