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
Difference between revisions of "iimTakeBrowserScreenshot()"
Jump to navigation
Jump to search
(12 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
Takes a screenshot of the current browser content or the current website. | Takes a screenshot of the current browser content or the current website. | ||
− | === Syntax === | + | === Syntax [[Image:IMacros-icon.png|iMacros Browser]] [[Image:Ie-icon.png|IE Plug-in]] [[Image:Ff-icon.png|Firefox]] [[Image:Cr-icon.png|Chrome]] === |
int ret_code = iimTakeBrowserScreenshot ( String FILEPATH, int 0/1 ) | int ret_code = iimTakeBrowserScreenshot ( String FILEPATH, int 0/1 ) | ||
− | |||
− | |||
=== Parameters === | === Parameters === | ||
Line 13: | Line 11: | ||
*:Output always is in PNG format | *:Output always is in PNG format | ||
*Int 0 or 1 | *Int 0 or 1 | ||
− | *:"0": take screenshot of browser | + | *:"0": take screenshot of browser (including browser GUI itself and browser error messages) |
− | *:"1": take screenshot of complete webpage | + | *:"1": take screenshot of complete webpage (webpage only, no browser GUI); required for tray/silent mode |
+ | |||
+ | 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. | ||
=== Return Codes === | === Return Codes === | ||
Line 20: | Line 20: | ||
* -1 Error (e.g. no browser) | * -1 Error (e.g. no browser) | ||
* -2: Wrong path | * -2: Wrong path | ||
− | * -3: System locked, no desktop. This can happen in mode 0 only. If you need to run iimTakeBrowserScreenshot on a server, use either mode = 1 or | + | * -3: System locked, no desktop ("[[How_to_avoid_black_screenshots|Black screenshots]]"). This can happen in mode 0 only. If you need to run iimTakeBrowserScreenshot on a server, use either mode = 1 or [[How_to_avoid_black_screenshots|use a "trick" to keep the desktop active]]. |
=== Examples === | === Examples === | ||
Line 30: | Line 30: | ||
if iscr < 0 then MsgBox "Could not take browser screenshot" | if iscr < 0 then MsgBox "Could not take browser screenshot" | ||
end if | end if | ||
+ | |||
+ | === Notes === | ||
+ | |||
+ | # You must specify a value of 1 for the second parameter when running in tray or silent mode. | ||
=== See Also === | === See Also === | ||
+ | |||
+ | [[iimInit]], [[iimPlay]], [[iimDisplay]], [[iimExit]], [[iimGetLastError]], [[iimGetLastExtract]] |
Revision as of 20:11, 22 March 2018
Takes a screenshot of the current browser content or the current website.
Syntax
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 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.
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
- 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