IE Screenshots are black when not connected via Remote Desktop to the VM hosting an IE Node

2,187 views
Skip to first unread message

Steve Smith

unread,
Jun 18, 2014, 12:07:26 PM6/18/14
to seleniu...@googlegroups.com
I have run into an issue with capturing screenshots in any version of Internet Explorer while using a Selenium Hub/Node setup.

I have Nodes setup on Virtual Machines (one for Firefox, Chrome, IE8, IE9, IE10 and IE11) and I am running tests via a Hub using these nodes.

I take screenshots at certain points in my tests. The screenshot code works correctly and my tests run fine. Furthermore Firefox and Chome take the screenshot without fail all of the time.
But the issue is when the test tries to take a screenshot in Internet Explorer (any version from 8 to 11). The screenshot is just a black box.

The IE driver takes a screenshot correctly if I am currently connected to the VM using Remote Desktop Connection; but once I close the Remote Desktop, screenshots are black.

Is this a known bug with the IEDriverServer, and is there a workaround for the issue? It is not feasible for me  to remain logged into 4 different IE VMs just to allow the Driver to capture a screenshot.

Steve Smith

unread,
Jun 18, 2014, 12:11:23 PM6/18/14
to seleniu...@googlegroups.com
I would also like to note:

 - I'm using c# to write my tests.
- The VMs have their screensaver disabled

Jim Evans

unread,
Jun 18, 2014, 1:01:18 PM6/18/14
to seleniu...@googlegroups.com
It's a known limitation. There is no known workaround. Complain to Microsoft. They're the ones that make the PrintWindow API (which is the proper API to use when grabbing screen captures) behave that way. Either that, or if you discover a way to make it work, you're welcome to submit a patch.

Nikesh Jauhari

unread,
Jun 18, 2014, 1:50:50 PM6/18/14
to seleniu...@googlegroups.com
Use VNC

David

unread,
Jun 18, 2014, 3:15:05 PM6/18/14
to seleniu...@googlegroups.com
As a workaround for now, I would recommend you consider VNC over remote desktop, or use a trick to reactivate a locked/disconnected desktop. See this blog post:


at the end of post, there's a link to a way to reactivate locked/disconnected desktop that should give you same benefit as VNC w/o VNC. I've not tried it though, I've been using VNC approach (but have no need to use it in the past 3 years).

dgold

unread,
Jan 18, 2018, 9:14:06 PM1/18/18
to Selenium Users
Hello - I am putting together some information for our Security Team.  We are using Selenium API 2.53 (latest version of Selenium 2) and IE11 on Windows10.  Since I can't get to the bottom link in the autumnator article mentioned in this post, can someone please tell me if they have a current work-around for this?  Is it possible to get Screenshots using IE11 if the screen is locked?  Thanks!

David

unread,
Jan 19, 2018, 3:02:39 PM1/19/18
to Selenium Users
It's unfortunate the specific article, http://www.allianceglobalservices.com/blog/executing-automation-suite-on-disconnectedlocked-machines, is no more, and that I don't recall the exact content of that article. I just recall it had to do with running some batch scripts that might invoke the command line RDP tool, maybe there might be registry settings as well or not.

What restrictions/limitations do you have to work with? The alternatives are to fire up a RDP session (preferably to console/admin session 0) whenever you need to run automation (the automation can trigger the RDP connect before test and disconnect after test), or use VNC to keep local desktop active and accessible (except when your security policy has enforced auto-lock timeout that void the VNC usefulness).

Although for VNC limitation with the auto-lock, one could work around that using a custom app that would periodically "move" mouse on desktop or type some keys, etc. and schedule the app with task scheduler to run every X minutes - something to keep desktop active so the auto-lock inactivity timeout would never trigger. Unless that too is against security policy.

dgold

unread,
Jan 23, 2018, 10:56:26 AM1/23/18
to Selenium Users

Thanks.  I actually have two motives here.  One is just confirming if our statement that we need an un-locked screen is still true to get system level screen shots.  We actually use Java’s built-in Robot libraries createScreenCapture(). The second is wondering if anyone is aware of a non-VNC, non-RDP solution, even if it means purchasing a Secure tool, to keep the UI/Session in a usable state for Automation.  Thanks.   

 

Note:  Our RDP problem is that the screen locks when you close it, in addition to the chance of differences in resolution and … in user’s connection.  VNC issue is that he Security team doesn’t like it.

David

unread,
Jan 23, 2018, 3:40:47 PM1/23/18
to Selenium Users
Yes, an unlocked screen is generally needed for UI interaction and screenshots. On Selenium side for screenshots may be browser specific, and at the moment does apply to IE.

For non-VNC, non-RDP solution, probably none exists or not well known. Maybe could be good business product to sell.

Your RDP problem on screen resolution can be addressed by using fixed test machine setup where you have an expected resolution (both client and server side). For screen lock when you close it, can't help that, just be sure that no one other than automation RDP's to the machine on admin/console session 0 (although on non-server Windows OS, it probably matters not, you only get more than additional sessions + admin/console session on server OSes. The admin/console session is the local desktop). For VNC, you could look for a enterprise grade VNC solution. There are multiple offerings, I assume there may be more secure versions you can pay for.

Also, on the VNC side, you could also avoid that if you have a local desktop (monitor, keyboard, mouse) you can access to that machine, then just make sure folks don't RDP to it. You could attempt to secure the machine by not having a monitor, keyboard, mouse connected to it and the ports covered up except when you need access to local desktop. Like if the machines were in a server room w/ restricted access, that could be secure enough to have a local desktop and not run VNC.
Reply all
Reply to author
Forward
0 new messages