Reputation: 163
I've been using Robot Framework successfully for test automation for a while, and Selenium 2 auto-screen captures have always worked perfectly.
Just this week while fixing a script I noticed that the Selenium2Library automatic screen captures are all 0 bytes.
Behind the scenes.... S2L simply sets the "Capture Page Screenshot" keyword as the keyword to run on failure. When I explicitly call the "Capture Page Screenshot" keyword in my script, a screenshot is captured, as expected.
However if one of my S2L steps fails, and a screenshot is automatically captured, that screenshot is 0 bytes.
Any idea why this would happen?
Upvotes: 1
Views: 158
Reputation: 3737
Well, you don't give much info on Selenium2Library and Selenium versions, Operative System and which Browser. Please try the example below (it works fine in my Fedora 22, x64 with Selenium2Library 1.7.4, Selenium 2.53.6, Firefox ESR 45.1.0, Google Chrome 52.0.2743.116 and PhantomJS 2.1.1):
*** Settings ***
Library Selenium2Library 15 2
*** Test Cases ***
Screen Capture Test
[Documentation] Using http://example.org/
Open Browser http://example.org/ ${BROWSER}
Wait Until Page Contains More information
Click Link More information...
Wait Until Page Contains I Love Robot Framework!
[Teardown] Close All Browsers
Upvotes: 0