captureEntirePageScreenshot operation testing IE with RC 1.0.1

662 views
Skip to first unread message

Paul Lucier

unread,
Sep 9, 2009, 2:57:07 PM9/9/09
to selenium-users...@googlegroups.com
We've created several test cases in Selenium IDE, and then tried running them in IE using RC 1.0.1, implemented by the following:

java -jar selenium-server.jar -port 4444 -htmlSuite *iexplore [http://webpage] "[\\server\|#]Selenium Scripts\Inventory\TestSuite-Inventory.html" "[\\server\TestResults\TestResults-Inventory.html|#]"

One issue we encounter is a failure to run any captureEntirePageScreenshot commands.  The error delivered by RC in our output says:

captureEntirePageScreenshot is only implemented for Firefox ("firefox" or "chrome", NOT "firefoxproxy") and IE non-HTA ("iexploreproxy", NOT "iexplore" or "iehta"). The current browser isn't one of them!

Is there a way to run these test scripts on IE and get screen shots captured?  Trying the iexploreproxy fails to run the script at all.

This is crucial for our testing implementation.

Regards,

Paul

Paul Lucier

unread,
Sep 10, 2009, 8:16:29 AM9/10/09
to selenium-users...@googlegroups.com
Screen shots are used for sequential empirical evidence for proof of functionality.  Our auditors require them.

I am aware of only two screen capture options in Selenium IDE: captureEntirePageScreenshot and captureEntirePageScreenshotAndWait.  None of the others you mentioned appear in documentation or in the command line of IDE.  If I am mistaken, please indicate where the other commands you mentioned are documented.

Paul Lucier

unread,
Sep 10, 2009, 8:38:10 AM9/10/09
to selenium-users...@googlegroups.com
I just ran across the following in Selenium IDE in the Reference pane regarding *{font:style=font-family: Arial;}captureEntirePageScreenshot{font}* commands.

{font:style=font-family: Arial;}*captureEntirePageScreenshotAndWait(filename, kwargs)
Generated from *captureEntirePageScreenshot(filename, kwargs)*Arguments:
filename - the path to the file to persist the screenshot as. No filename extension will be appended by default. Directories will not be created if they do not exist, and an exception will be thrown, possibly by native code.
kwargs - a kwargs string that modifies the way the screenshot is captured. Example: "background=#CCFFDD" . Currently valid options:
background
the background CSS for the HTML document. This may be useful to set for capturing screenshots of less-than-ideal layouts, for example where absolute positioning causes the calculation of the canvas dimension to fail and a black background is exposed (possibly obscuring black text).
{font:font-family=Arial}Saves the entire contents of the current window canvas to a PNG file.
{font}
*{font}

*{font:style=color: #ff0000; font-family: Arial;}Contrast this with the captureScreenshot command, which captures the contents of the OS viewport{font}* {font:style=font-family: Arial;}(i.e. whatever is currently being displayed on the monitor), {font}*{font:style=color: #ff0000; font-family: Arial;}{font:style=color: #ff0000; font-family: Arial;}and is implemented in the RC only{font}{font}*{font:style=font-family: Arial;}. Currently this only works in Firefox when running in chrome mode, and in IE non-HTA using the EXPERIMENTAL "Snapsie" utility. The Firefox implementation is mostly borrowed from the Screengrab! Firefox extension. Please see {font}[http://www.screengrab.org/]{font:style=font-family: Arial;} and {font}[http://snapsie.sourceforge.net/]{font:style=font-family: Arial;} for details.{font}

Thanks for the suggestion.

I'll make copies of my scripts, and substitute each incidence of *captureEntirePageScreenshot* with {font:style=color: #ff0000;}*captureScreenshot.*  {font}{font:style=color: #000000;}I'll let you know how I make out.{font}

Paul Lucier

unread,
Sep 10, 2009, 11:29:40 AM9/10/09
to selenium-users...@googlegroups.com
We use IDE to create our scripts.  After creating test suites for these scripts in Notepad, we discovered that we could then run these test suites using RC.  that's when the "fun" began.

By the way, my first attempt to substitute one of your suggested alternate screen capture commands (captureScreenshot) yielded an "unrecognized command" error from RC.
Unfortunately, our SOP and Work Instructions don't permit us to forego screen captures for testing.

Paul Lucier

unread,
Sep 10, 2009, 11:31:36 AM9/10/09
to selenium-users...@googlegroups.com
Byh the way, can you point me to some RC documentation that would be helpful in identifying command differences between RC and IDE?

Thanks.

Regards,

Paul

Edmund Yan

unread,
Sep 10, 2009, 7:25:52 PM9/10/09
to selenium-users...@googlegroups.com
"We use IDE to create our scripts.  After creating test suites for these scripts in Notepad, we discovered that we could then run these test suites using RC.  that's when the "fun" began."
I dont' understand what you're saying?  Are you using selenium IDE's built in conversion tool to convert your HTML selenium code to some programming language?

But like what you posted on the 3rd post, the function captureEntirePageScreenshot only works in firefox.  You can install snapsie and the function will also work for IE, otherwise the function will not work.

I actually don't think there is a difference between IDE and RC in terms of what the functions do.

Paul Lucier

unread,
Sep 11, 2009, 8:05:03 AM9/11/09
to selenium-users...@googlegroups.com
After a little more experimenting and examination of my results output, I discovered that replacing *iexplore with "iexploreproxy" (including the quotes) in the command line yielded me the results I was looking to achieve, including capturing screen shots.  Each of the screen shots appeared in the specified path.

Thanks for all the input!

Puneet Jagtiani

unread,
Sep 14, 2009, 3:36:26 AM9/14/09
to selenium-users...@googlegroups.com
I am using captureScreenshot function in scripts and it is working in all browsers

Paul Lucier

unread,
Sep 14, 2009, 8:12:48 AM9/14/09
to selenium-users...@googlegroups.com
Unfortunately, though the script I was using to test IE with Selenium RC said it captured my screen shots, it in fact did not.  No image files were placed in the specified path.

So, Puneet, how did you manage to get screen captures for all your browsers using RC?

Regards,

Paul

Puneet Jagtiani

unread,
Sep 14, 2009, 8:29:38 AM9/14/09
to selenium-users...@googlegroups.com
Hope this code snippest will help u:

screenshotsResultsPath = new File(RESULTS_BASE_PATH + File.separator\\                 + SCREENSHOT_PATH).getAbsolutePath();

String ScreenShotPath = screenshotsResultsPath + File.separator\\                         + RemoveCharacter(TestName, " ")\\                         + LoggingUtils.timeStampForFileName() + ".png";

selenium.captureScreenshot(ScreenShotPath);

Remember *ScreenShotPath is absolute path*

u can get more help at "http://loggingselenium.sourceforge.net/usage.html"

Paul Lucier

unread,
Sep 14, 2009, 11:07:20 AM9/14/09
to selenium-users...@googlegroups.com
Puneet,

You said "I am using captureScreenshot function in scripts and it is working in all browsers".  Yet when I invoke that same command in RC specifying either iexplore or iexploreproxy in the command line, it returns an "Unknown command: 'captureScreenshot'" message, failing the step.

Would you help me understand how you make a command work for you that returns "Unknown command: 'captureScreenshot'" for me?  This has me baffled.

What version of Selenium RC and IDE are you using / have you used?

Regards,

Paul

Paul Lucier

unread,
Sep 14, 2009, 11:24:15 AM9/14/09
to selenium-users...@googlegroups.com
Edmund,

You mentioned using SnapsIE.  I have had difficulty locating documentation on how to use it.  The SnapsIE page only tells you how to register the .dll; it says nothing regarding how to invoke it in an html test script, what command to use, etc.

If you would elucidate, I would be deeply appreciative.

Regards,

Paul

Puneet Jagtiani

unread,
Sep 14, 2009, 1:42:56 PM9/14/09
to selenium-users...@googlegroups.com
Paul,
I am not using the latest selenium releases as they are not so much used in
market to rely on. So I am using selenium RC 0.9 and IDE 0.8x

Thanks & Regards,

Puneet Jagtiani

Reply all
Reply to author
Forward
0 new messages