Skip to content
This repository was archived by the owner on Nov 29, 2018. It is now read-only.
This repository was archived by the owner on Nov 29, 2018. It is now read-only.

Spurious truncated screenshots with IEDriver on Win7 IE10 / IE11 (at least 64bit) with Selenium 2.44 #8488

Open
@lukeis

Description

@lukeis

Originally reported on Google Code with ID 8488

Dear developers, 

we have some strange/annoying problems with IEDriver on Win7 / Win8 and IE 10 / IE
11.
The machines are 64bit as well as the used IEDriverServer executables. The (virtual)
hardware is kind of low-performance. Debugging was performed using Selenium 2.44.04
(which is not the most up-to-date version but more recent versions on our production
servers did not give better results).

I have checked that we have all registry values properly set as described at https://code.google.com/p/selenium/wiki/InternetExplorerDriver

I have an artificial test script that does the following:

1) get() a web page (for this I have created a very simple page with a div with height
3000px)
2) sleep 20 seconds
3) create a screenshot

Sometimes (in about 50% of all cases) the screenshots are truncated at the viewport
boundaries.
These 50% of cases appear clustered, i.e. if it happens, it happens every time for
a while, if it does not
happen, everything is fine for a while. Sometimes, the problem disappears for a while
when the machine is rebooted, sometimes it does not.

I have checked that we have no problems with the console session (I am logged in by
VNC).

I have checked that the driver is indeed 64bit to rule out the open bitness-related
problem with Windows hooks reported by Jim Evans. 

When I create a test script that 

1) gets a page 
2) sequentially creates 20 screenshots

I see that the first 4 or 5 screenshot are complete, the other 15 truncated. Truncation
starts always after 5 or 6 seconds.

The log files (log level TRACE) do not show anything interesting after these 4 or 5
seconds. Nor does the screenshot handler output looks any different for the "good"
cased or the bad ones.

I have equipped the ScreenshotCommandHandler with OutputDebugString() commands to be
able to observe the behavior also in the CallWndProc hook and the WndProc. (I actually
have not the faintest clue about Windows programming, so maybe this is not how these
things are usually debugged). What I see is that in the "bad cases" InstallWindowsHook()
does indeed install the hook correctly (at least ::SetWindowsHookEx() does not return
NULL) However, the windows hook is never executed. In the first test case described
above with Sleep(20) the Hook is not even called once, hence I would rule out some
Win7 nazi mechanism reaping bad-behaved hooks. 

I got the impression that the situation "improves" (in the sense that the probability
of truncated screenshots is reduced) when the screenshot handler runs "slower". For
instance, setting the log level to TRACE improves the situation a lot as well when
I put a Sleep exactly *before* the InstallWindowsHooks() call. 

All in all, this is very difficult to debug for a Windows noob like me and that the
problem sometimes disappears for no visible reason only to reappear 30 minutes later
makes debugging not easier.

Are there any more things I can try? Any ideas where this magical wall of 5 seconds
may come from (I have found a suspicious registry setting called LowLevelHooksTimeout
but changing the value did not help and CallWndProc is not a low level hook, anyway).


As a hint, the situation seems to be far better with faster computers. On my local
machine with a Win8 IE11 virtual machine, out of 50 screenshots "only" 3 are truncated
(but not sure if this is related).

Reported by [email protected] on 2015-02-13 13:40:23

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions