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

Screenshot taken using 32-bit IE driver is truncated while it is complete when using 64bit #5876

Open
lukeis opened this issue Mar 4, 2016 · 17 comments

Comments

@lukeis
Copy link
Member

lukeis commented Mar 4, 2016

Originally reported on Google Code with ID 5876

What steps will reproduce the problem?
1. Open any webpage that causes the browser scroll to appear.
2. Take a screenshot.

What is the expected output? What do you see instead?
The screenshot taken using the 32bit driver should not be truncated. See the attached
images for reference and comparison.

Selenium version: 2.33
OS: Windows 7 and Windows 8
Browser: Internet Explorer
Browser version: 10

Below is the code that I used. The same code worked well in Chrome, Firefox, and 64bit
IEDriver.

Screenshot screenShot = ((ITakesScreenshot)webDriverList[index - 1]).GetScreenshot();

string tempScreenshotFileName = Path.GetTempFileName();

screenShot.SaveAsFile(tempScreenshotFileName, System.Drawing.Imaging.ImageFormat.Png);

fileBuffer = File.ReadAllBytes(tempScreenshotFileName);

File.Delete(tempScreenshotFileName

Reported by ruffy.loquia on 2013-07-03 14:48:02


- _Attachment: error_4bcf4a51bdfa4069b264d09d33a7b183.png
![error_4bcf4a51bdfa4069b264d09d33a7b183.png](https://storage.googleapis.com/google-code-attachments/selenium/issue-5876/comment-0/error_4bcf4a51bdfa4069b264d09d33a7b183.png)_ - _Attachment: error_ef0b9350dbd74da892963f6277c6aac2.png
![error_ef0b9350dbd74da892963f6277c6aac2.png](https://storage.googleapis.com/google-code-attachments/selenium/issue-5876/comment-0/error_ef0b9350dbd74da892963f6277c6aac2.png)_
@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

For clarification, the first (truncated) screenshot was taken using the 32bit IEDriverServer
while the second (complete) screenshot was taken using the 64bit IEDriverServer. Everything
else are the same (code, driver versions, and OS)

Reported by ruffy.loquia on 2013-07-03 14:49:49

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Hi!

Looks like IEDriver incorrectly determines sizes of screenshoted window.
Do you use switching to frame before screenshooting or
your site uses something fixed sized ?

Could you provide additional information:
* executable test scenario
* public URL or HTML+CSS+JS of page at which problem is reproduced
* TRACE log of IEDriver (for both ie32 and ie64)
?

Reported by a.u.savchuk on 2013-07-21 10:30:26

  • Status changed: NeedsClarification
  • Labels added: Browser-IE, Component-WebDriver

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Attached is a working console application that will demonstrate the issue.

Reported by ruffy.loquia on 2013-07-23 01:14:01


- _Attachment: [IEWebDriverPOC.zip](https://storage.googleapis.com/google-code-attachments/selenium/issue-5876/comment-3/IEWebDriverPOC.zip)_

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

hm. on my Vista x32 ie9 result is correct - no black area. i'll check at x64 wit ie10.

Reported by a.u.savchuk on 2013-07-23 05:11:40

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Attaching the trace logs.

Reported by ruffy.loquia on 2013-07-24 03:53:18


- _Attachment: [IEDRiverServer_32_bit_Trace.log](https://storage.googleapis.com/google-code-attachments/selenium/issue-5876/comment-5/IEDRiverServer_32_bit_Trace.log)_ - _Attachment: [IEDRiverServer_64_bit_Trace.log](https://storage.googleapis.com/google-code-attachments/selenium/issue-5876/comment-5/IEDRiverServer_64_bit_Trace.log)_

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Yes. Reproduced at Win7 x64 with IE 10 x32.

Reported by a.u.savchuk on 2013-08-12 23:07:20

  • Status changed: Accepted

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Issue 5292 has been merged into this issue.

Reported by barancev on 2013-10-20 10:36:00

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Issue 6566 has been merged into this issue.

Reported by barancev on 2013-11-20 08:36:15

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Is there a way to find out the timeline on this issue getting fixed? I see the status
is Untriaged.  Our team is very much in need of this fix for our project. Thanks! Courtenay

Reported by chteska on 2014-01-14 14:46:55

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

After investigation of this issue, I have been able to debug the C++ code of the 64-bit
IE driver to determine the root cause. When you are running IE 10 or higher on a 64-bit
version of Windows, by default the process which hosts the containing window that includes
the browser chrome (address bar, navigation buttons, menus, etc.) is a 64-bit process.
The process which hosts the window where content is actually rendered (within each
tab) is a 32-bit process.

By default, the IE driver must use a windows hook on the top-level window to allow
the browser to resize large enough to display the entire page canvas. This is where
the problem is. The windows hook is not installed, because a 64-bit process (the top-level
window process) can't execute 32-bit code (the windows hook code in the 32-bit IEDriverServer.exe).
The only way to properly fix this will be to create a second (64-bit) executable to
perform the window resize. Since fixing this would amount to a massive rearchitecture
of the IE driver's binary components, no timeline is (or will be) available for this
change.

Reported by james.h.evans.jr on 2014-01-31 19:26:27

  • Labels removed: Status-Untriaged

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

It would be useful if Issue 3072 or 5876 is fixed. at the moment both IEDRIVERSERVER
are having issues. 64 bit takes full screenshots but very slow. 32 bit runs fast but
failing to take full screenshot.

Thanks

Reported by madhav.kadiyala on 2014-07-02 13:41:34

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Issue 5292 has been merged into this issue.

Reported by james.h.evans.jr on 2014-08-05 15:10:42

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Any idea on when we might see a fix for this issue?  We use the IEDRIVER at Amazon and
we have several teams this is impacting, so it would be great if we new when a fix
might come through.

Reported by dave@mozealous.com on 2014-09-11 20:43:07

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

From comment #10 above: "Since fixing this would amount to a massive rearchitecture
of the IE driver's binary components, no timeline is (or will be) available for this
change." If someone from Amazon (or anywhere else, for that matter) would like to attempt
undertaking the rearchitecture required to fix this issue, I would be happy to walk
them through the current code setup and the design constraints and requirements imposed
by the Selenium project's user base.

Reported by james.h.evans.jr on 2014-09-12 10:51:46

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Hey James

Has any work on this bug started yet? If not, could you give me some pointers where
I can start looking into the code to fix the issue?

Reported by vaibhav.agarwal1991 on 2014-09-16 05:18:15

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

No work has been started on this bug. None is likely to begin in the foreseeable future.
The code for screenshots is in ScreenshotCommandHandler.h, but the reasons this is
not a simple fix are detailed in the blog post here: http://jimevansmusic.blogspot.com/2014/09/screenshots-sendkeys-and-sixty-four.html.
You're welcome to try to take on the effort of rearchitecting the IE driver to fix
this issue, but the proper fix is very complicated, and likely won't meet project requirements
for deployment simplicity.

Reported by james.h.evans.jr on 2014-09-16 23:44:10

@lukeis
Copy link
Member Author

lukeis commented Mar 4, 2016

Reported by luke.semerau on 2015-09-17 17:45:54

  • Labels added: Restrict-AddIssueComment-Commit

@SeleniumHQ SeleniumHQ locked and limited conversation to collaborators Mar 4, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant