The renewal maintenance has officially ended for Progress iMacros effective November 30, 2023.
This Wiki site will also no longer be moderated from the Progress side.
Thank you again for your business and support.
Sincerely, The Progress Team
iimTakeBrowserScreenshot()
(Redirected from iimTakeBrowserScreenshot)
Jump to navigation
Jump to search
Takes a screenshot of the current browser content or the current website.
Syntax
int ret_code = iimTakeBrowserScreenshot ( String FILEPATH, Int MODE )
Parameters
- String FILEPATH
- Defines where to save the screenshot. e.g. "c:\myscreenshots\testpage.png"
- Output always is in PNG format
- Int MODE (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
- See notes section below for specific browser support and behavior
Return Codes
- -1 Error (e.g. no browser)
- -2: Wrong path
- -3: System locked, no desktop ("Black screenshots"). This can happen in mode 0 only. If you need to run iimTakeBrowserScreenshot on a server, use either mode = 1 or use a "trick" to keep the desktop active.
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
iMacros for Internet Explorer supports 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.
- Supports both modes.
- Taking a screenshot of the browser window (MODE 0) while the browser is in tray/silent mode results in a black screenshot. Use MODE 1 instead.
- Mode 0 (Browser) does not capture browser UI, only visible portion of web page; Mode 1 (Page) does the same as mode 0 (use SCREENSHOT TYPE=PAGE in a macro to capture full web page).
- Mode 0 (Browser) is not supported (returns error -1); Mode 1 (Page) captures only visible portion of web page (use SCREENSHOT TYPE=PAGE in a macro to capture full web page).
- 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