iimTakeBrowserScreenshot()

From iMacros
Revision as of 15:14, 30 November 2016 by Kg (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Takes a screenshot of the current browser content or the current website.

Syntax iMacros Browser IE Plug-in Firefox Chrome

int ret_code = iimTakeBrowserScreenshot ( String FILEPATH, int 0/1 )

Parameters

  • String FILEPATH
    Defines where to save the screenshot. e.g. "c:\myscreenshots\testpage.png"
    Output always is in PNG format
  • Int 0 or 1
    "0": take screenshot of browser (including browser GUI itself and browser error messages)
    "1": take screenshot of complete webpage (webpage only, no browser GUI); required for tray/silent mode

iMacros for Internet Explorer support both modes, Firefox supports both modes except in v. 9.0.3, where neither one works (fix in progress), iMacros for Chrome supports mode 1 only.

Return Codes

Examples

 i = iim1.iimPlay("salesforce test1")
 'Take screenshot of error
 If i < 0  then
   iscr = iim1.iimTakeBrowserScreenshot ("./screenshot salesforce error  "  & Hour(Now)&Minute(Now)&Second(Now) & ".png")  
   if iscr  < 0 then MsgBox "Could not take browser screenshot" 
 end if

Notes

  1. You must specify a value of 1 for the second parameter when running in tray or silent mode.

See Also

iimInit, iimPlay, iimDisplay, iimExit, iimGetLastError, iimGetLastExtract