Issue 3536 in selenium: Capture Screenshot keyword captures black screen for IE

184 views
Skip to first unread message

sele...@googlecode.com

unread,
Mar 12, 2012, 5:01:15 AM3/12/12
to selenium-develope...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 3536 by totzi...@gmail.com: Capture Screenshot keyword captures
black screen for IE
http://code.google.com/p/selenium/issues/detail?id=3536

I have 3 virtual machines with various versions of IE. All of the
screenshots captured are black screens regardless whether the virtual
machines and the host are locked or not. The test automation is triggered
from Hudson.

When I manually tested Capture Screenshot keyword using IE, it seemed to be
fine. However after I left the virtual machines over the weekend for test
execution, the problem started. Rebooting the virtual machines and the host
did not help.

I don't see anything abnormal in selenium log.

Virtual Machine 1
------------------
Selenium version:
2.8.1 package but replace selenium-server.jar with 2.20.0

Robot Framework version:
2.6.3

OS:
Windows XP SP3

Browser:
Internet Explorer 7


Virtual Machine 2
------------------
Selenium version:
2.8.1 package but replace selenium-server.jar with 2.20.0

Robot Framework version:
2.6.3

OS:
Windows XP SP3

Browser:
Internet Explorer 8


Virtual Machine 3
------------------
Selenium version:
2.8.1 package but replace selenium-server.jar with 2.20.0

Robot Framework version:
2.6.3

OS:
Windows 7 Ultimate SP1 (32 bit)

Browser:
Internet Explorer 9

sele...@googlecode.com

unread,
Mar 14, 2012, 5:27:52 PM3/14/12
to selenium-develope...@googlegroups.com

Comment #1 on issue 3536 by james.h....@gmail.com: Capture Screenshot

Issue 3561 has been merged into this issue.

sele...@googlecode.com

unread,
Mar 18, 2012, 11:06:24 AM3/18/12
to selenium-develope...@googlegroups.com

Comment #2 on issue 3536 by jochende...@gmail.com: Capture Screenshot

Have you tried leaving a VNC server running on every virtual machine?

We had this issue where Windows would sometimes cause black screens because
the machine/desktop was not in use. Running a VNC service on those machines
fixed that problem for us.

sele...@googlecode.com

unread,
Mar 19, 2012, 5:26:57 AM3/19/12
to selenium-develope...@googlegroups.com

Comment #3 on issue 3536 by totzi...@gmail.com: Capture Screenshot keyword

Thanks for the suggestion. Our test automation job is triggered remotely
from Hudson actually. With VNC, I have no idea how we can accomplish the
tasks done in Hudson (i.e. check out newly updated files, display the
results in Hudson job, multiple Hudson jobs dependency, etc)

sele...@googlecode.com

unread,
Mar 20, 2012, 6:49:15 AM3/20/12
to selenium-develope...@googlegroups.com

Comment #4 on issue 3536 by totzi...@gmail.com: Capture Screenshot keyword

Found a workaround utilising the idea of VNC server. Instead of using VNC
server, I remove the Hudson windows service at the slave node. I create a
batch file using command mode to establish the connection to Hudson.

Content of the sample batch file (assume it's called test.bat) is as
follows. c:\my-slave\ is the location of slave.jar.

cd c:\my-slave\
"C:\Program Files"\Java\jre6\bin\java -jar slave.jar -jnlpUrl
http://myhudson.com:8080/computer/my_machine_99/slave-agent.jnlp

Place the newly created batch file, test.bat, into the Windows Startup
directory to launch the batch file each time it's logon.

With this solution, I don't get black screenshot anymore.

sele...@googlecode.com

unread,
Mar 20, 2012, 6:53:16 AM3/20/12
to selenium-develope...@googlegroups.com

Comment #5 on issue 3536 by totzi...@gmail.com: Capture Screenshot keyword

By the way, the Robot Framework command used is "Capture Screenshot" (not
Capture Page Screenshot). Ideally, Capture Page Screenshot is preferred
because the entire page can be captured but it does not seem to be able to
work at all for Internet Explorer.

sele...@googlecode.com

unread,
Apr 10, 2012, 6:55:50 PM4/10/12
to selenium-develope...@googlegroups.com

Comment #6 on issue 3536 by dawa...@gmail.com: Capture Screenshot keyword

We've found that the first screenshot taken with a driver often is all
black, but subsequent ones will not be; try taking the screenshot again

sele...@googlecode.com

unread,
Apr 10, 2012, 8:28:46 PM4/10/12
to selenium-develope...@googlegroups.com

Comment #7 on issue 3536 by totzi...@gmail.com: Capture Screenshot keyword

The black screen capturing issue I encountered was always black screen
being captured regardless how many times I run the robot framework script.
I didn't try capturing the same screen more than once within the same
script though. That could be a potential workaround too.

Anyway, it has been overcome by my workaround above utilising a batch file
to establish connection to Hudson instead of using windows service.

Thanks for the suggestion anyway as it has given me more workaround ideas.

sele...@googlecode.com

unread,
Apr 19, 2012, 5:56:16 AM4/19/12
to selenium-develope...@googlegroups.com

Comment #8 on issue 3536 by jaruz...@gmail.com: Capture Screenshot keyword

I have the same problem and I've tried the VNC workaround, but it didn't
work for me. Could you please post your VNC version and settings?

sele...@googlecode.com

unread,
Apr 19, 2012, 7:36:13 AM4/19/12
to selenium-develope...@googlegroups.com

Comment #9 on issue 3536 by jaruz...@gmail.com: Capture Screenshot keyword

I finally managed to get a workaround for this issue.
In my case, the problem was that I connected to my test servers with Remote
Desktop, which locks the computer after disconnect (I haven't found any way
to change this behaviour). If the test computer is locked, IE screenshots
go black.
So I've created a disconnect.bat file with this line:
tscon rdp-tcp#0 /dest:console

Instead of disconnecting from remote desktop, I run disconnect.bat and my
test computer doesn't get locked. Now I have real screenshots :)
I have to credit Nepatsfan from:
http://forum.soft32.com/windows/stop-Remote-Desktop-locking-host-ftopict360189.html
for give me a hint on this.

sele...@googlecode.com

unread,
May 11, 2012, 1:16:13 AM5/11/12
to selenium-develope...@googlegroups.com
Updates:
Labels: Component-WebDriver Browser-IE

Comment #10 on issue 3536 by barancev: Capture Screenshot keyword captures
(No comment was entered for this change.)

sele...@googlecode.com

unread,
May 17, 2012, 1:28:21 AM5/17/12
to selenium-develope...@googlegroups.com

Comment #11 on issue 3536 by caeserw...@gmail.com: Capture Screenshot
keyword captures black screen for IE
http://code.google.com/p/selenium/issues/detail?id=3536

I got the same issue on my VMs. I used selenium grid to manage 10 nodes on
10 VMs. 5 of the VMs are windows7 x64 with IE9. The screenshot from these 5
VMs are always black if it not in use. The selenium version is 2.13. But it
worked properly on other 5 VMs whose OS is windows xp with IE8, even if the
VMs are not in use. Do you have schedule to fix is issue?

sele...@googlecode.com

unread,
May 17, 2012, 10:59:35 AM5/17/12
to selenium-develope...@googlegroups.com

Comment #12 on issue 3536 by simon.m.stewart: Capture Screenshot keyword
Please update to the latest selenium release (2.21 as I write this) and
retry. A fix for just this problem landed relatively recently.

sele...@googlecode.com

unread,
May 18, 2012, 6:31:11 AM5/18/12
to selenium-develope...@googlegroups.com

Comment #13 on issue 3536 by jaruz...@gmail.com: Capture Screenshot keyword
I'm running selenium 2.21 and I've got the same problem. See my workaround:
http://code.google.com/p/selenium/issues/detail?id=3536#c9

sele...@googlecode.com

unread,
Aug 8, 2012, 9:53:40 AM8/8/12
to selenium-develope...@googlegroups.com

Comment #14 on issue 3536 by karsten....@gmail.com: Capture Screenshot
keyword captures black screen for IE
http://code.google.com/p/selenium/issues/detail?id=3536

I used your workaround from
http://code.google.com/p/selenium/issues/detail?id=3536#c9 . Works nicely
for me. Thanks

sele...@googlecode.com

unread,
Aug 17, 2012, 3:03:15 PM8/17/12
to selenium-develope...@googlegroups.com

Comment #15 on issue 3536 by mdzy...@google.com: Capture Screenshot keyword
I see the same issue. I am running selenium-server-standalone-2.23.0.jar on
Win7. The screenshot in IE9 are completely black. This happens
intermittently.

sele...@googlecode.com

unread,
Aug 27, 2012, 11:28:03 PM8/27/12
to selenium-develope...@googlegroups.com

Comment #16 on issue 3536 by jri...@gmail.com: Capture Screenshot keyword
Regarding comment 9, it works for me. I also added this line to the batch
file, since occasionally someone will log into the machine while someone
else is on:

tscon rdp-tcp#1 /dest:console

sele...@googlecode.com

unread,
Nov 1, 2012, 9:11:18 AM11/1/12
to selenium-develope...@googlegroups.com

Comment #17 on issue 3536 by adi...@gmail.com: Capture Screenshot keyword
This still happens in webdriver 2.25

sele...@googlecode.com

unread,
Feb 11, 2013, 3:36:33 PM2/11/13
to selenium-develope...@googlegroups.com

Comment #18 on issue 3536 by Vk.Vi...@gmail.com: Capture Screenshot keyword
Hi all. #4 also works for me with the latest IE 2.29.1 webdriver version.
The question is what is the basic difference between jnlp and windows
service for establishing connection between master and slave that in case
of jnlp connection - it works?

sele...@googlecode.com

unread,
May 24, 2013, 10:06:07 AM5/24/13
to selenium-develope...@googlegroups.com

Comment #19 on issue 3536 by 11eg...@gmail.com: Capture Screenshot keyword
I faced the same issue. It's shocking that Chrome update helps! Just update
your chrome.

--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

sele...@googlecode.com

unread,
Aug 14, 2013, 6:39:45 AM8/14/13
to selenium-develope...@googlegroups.com
Updates:
Status: WorkingAsIntended

Comment #20 on issue 3536 by a.u.savchuk: Capture Screenshot keyword
It's configuration problem not selenium.

Just a few notes about screenshots for "headless" configuration:

1. if you use service-based configuration you _need_ to setup it to use
local account.
SYSTEM account doesn't have possibility to interact to desktop.
Be sure that you local account can log in successfully.

2. if you use service-based configuration you _need_ to set "Allow service
to interact with desktop" option enabled for the service. Otherwise service
can not interact with desktop.

3. If you use RDP to run grid2 node please be sure that you session doesn't
become locked. Use something like "tscon SessionID /dest:console" to close
the Remote Desktop session and reconnects the session to the remote
computer's console.

4. If you use RDP to run grid2 node please do not disconnect from the
Remote Desktop Connection session, lock the computer or minimize the Remote
Desktop window. In such case Windows switches the Remote Desktop session to
the GUI-less mode and does not draw the GUI. It prevents to take
screenshots.
You could change this behaviour by setting:
HKEY_CURRENT_USER\Software\Microsoft\Terminal Server
Client\RemoteDesktop_SuppressWhenMinimized = 2
HKEY_LOCAL_MACHINE\Software\Microsoft\Terminal Server
Client\RemoteDesktop_SuppressWhenMinimized = 2
(another keys may be used on x64)
and rebooting after.

Another good solution is to use VNC instead of RDP.

Working as intended from my point.

Also be note that some features of IEDriverServer (proxy at current moment)
_can not_ work in service mode.

sele...@googlecode.com

unread,
Jan 3, 2014, 2:11:07 AM1/3/14
to selenium-develope...@googlegroups.com

Comment #21 on issue 3536 by praneeth...@gmail.com: Capture Screenshot
keyword captures black screen for IE
http://code.google.com/p/selenium/issues/detail?id=3536

I have tried using selenium 2.33 jar and IEDriverServer 2.33 library.

Windows 8, IE 10 screen shot works well
Windows XP IE 8 Screen shot works well
but in Windows 7 IE9 browser screen shot is black, i have tried the work
around mentioned by a.u.s...@gmail.com , but it does not works in IE 9
windows7

sele...@googlecode.com

unread,
Jan 3, 2014, 3:35:28 AM1/3/14
to selenium-develope...@googlegroups.com

Comment #22 on issue 3536 by jaruz...@gmail.com: Capture Screenshot keyword
Have you tried this workaround:
https://code.google.com/p/selenium/issues/detail?id=3536#c9 ?

sele...@googlecode.com

unread,
Feb 10, 2014, 5:36:29 PM2/10/14
to selenium-develope...@googlegroups.com

Comment #23 on issue 3536 by SBergst...@gmail.com: Capture Screenshot
keyword captures black screen for IE
http://code.google.com/p/selenium/issues/detail?id=3536

I'm running Windows 7 IE9 and getting the black screenshot referenced in
#21, without using remote desktop; however, the browser in question is
running an applet. Is the applet likely the cause? Or the particular
browser I'm using?

sele...@googlecode.com

unread,
Jun 28, 2014, 2:48:38 PM6/28/14
to selenium-develope...@googlegroups.com

Comment #24 on issue 3536 by bikash.c...@rightster.com: Capture Screenshot
keyword captures black screen for IE
http://code.google.com/p/selenium/issues/detail?id=3536

for me comment #20 a.u.savchuk helped. Remote desktop Login was the
problem. I rerun test after disconnecting remote desktop Login it's working
fine.

sele...@googlecode.com

unread,
Sep 20, 2014, 3:20:14 AM9/20/14
to selenium-develope...@googlegroups.com

Comment #25 on issue 3536 by anand4...@gmail.com: Capture Screenshot
keyword captures black screen for IE
https://code.google.com/p/selenium/issues/detail?id=3536

I am running Windows 7 IE8 64 bit, the first 3 screen is fine after that I
am getting black

sele...@googlecode.com

unread,
Sep 20, 2014, 3:48:26 AM9/20/14
to selenium-develope...@googlegroups.com

Comment #26 on issue 3536 by anand4...@gmail.com: Capture Screenshot
keyword captures black screen for IE
https://code.google.com/p/selenium/issues/detail?id=3536

I am facing this issue in Desktop

sele...@googlecode.com

unread,
Oct 15, 2014, 12:12:00 AM10/15/14
to selenium-develope...@googlegroups.com

Comment #27 on issue 3536 by evgeny.m...@gmail.com: Capture Screenshot
keyword captures black screen for IE
https://code.google.com/p/selenium/issues/detail?id=3536

"tscon SessionID /dest:console" actually helped to capture proper non-black
screenshots, but I noticed that driver.manage().window().setSize() method
does not work in this case. Any thoughts on this?

win-7x64, IE11, IEDriverServer-2.42

sele...@googlecode.com

unread,
Oct 15, 2014, 1:19:40 AM10/15/14
to selenium-develope...@googlegroups.com

Comment #28 on issue 3536 by evgeny.m...@gmail.com: Capture Screenshot
keyword captures black screen for IE
https://code.google.com/p/selenium/issues/detail?id=3536

>> but I noticed that driver.manage().window().setSize() method does not
>> work in >>this case.

Either in chrome

sele...@googlecode.com

unread,
Nov 18, 2014, 6:28:51 AM11/18/14
to selenium-develope...@googlegroups.com

Comment #29 on issue 3536 by jorge.me...@gmail.com: Capture Screenshot
keyword captures black screen for IE
https://code.google.com/p/selenium/issues/detail?id=3536

I've used @jaruz tip and it has worked perfectly for my slave nodes (VMs).

Special very thanks!!!!
Reply all
Reply to author
Forward
0 new messages