rshf / chromedriver

Automatically exported from code.google.com/p/chromedriver
2 stars 1 forks source link

ChromeDriver2 take screenshot is not full page #294

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
In version 2 ChromeDriver started making a screenshot is not the whole page, 
but only part of it.
Here is some code (the result in Attach)

-------------------
from pyvirtualdisplay import Display
from selenium import webdriver
from threading import Timer

display = Display(visible=0, size=(1200, 800))
display.start()

chromeOps = webdriver.ChromeOptions()
chromeOps._binary_location = "/usr/bin/google-chrome"

driver = webdriver.Chrome('../chromedriver2', port=4445, 
chrome_options=chromeOps) # Optional argument, if not specified will search 
path. 
driver.get('http://trinixy.ru')
driver.save_screenshot('screenie.png')
driver.quit()
display.stop()
-------------------

ChromeDriver = 2 (r191457)
Chrome = Google Chrome 26.0.1410.43 
OS = Debian and Ubuntu

Original issue reported on code.google.com by jiexa....@gmail.com on 31 Mar 2013 at 8:38

Attachments:

GoogleCodeExporter commented 9 years ago
There is neither a workaround nor a patch.  I personally tried porting SnapsIE 
to NPAPI to work with Chrome and had very mixed results.  But even that isn't 
much of a solution since NPAPI is being removed from Chrome in two months.

The sad truth of the matter is everyone on this ticket is just out of luck.  
And it sounds like it won't be resolved until that 3.5 year old Chromium issue 
is resolved.  But there seems to be no interest in resolving that either.  So, 
I wouldn't expect this issue to be resolved anytime soon.

Original comment by nirvd...@gmail.com on 26 Oct 2013 at 2:38

GoogleCodeExporter commented 9 years ago
Able to generate Full screenshot through Stitching Images using awt package 
methods. 
In some pages of the product I am working, it still causes few issues. 
Expecting a fix soon

Original comment by kishoreb...@gmail.com on 31 Oct 2013 at 6:38

GoogleCodeExporter commented 9 years ago
Issue 393 has been merged into this issue.

Original comment by kkania@chromium.org on 6 Nov 2013 at 6:43

GoogleCodeExporter commented 9 years ago
Please reopen this bug and fix ASAP. At least let know when would this be fixed?

Original comment by a...@wingify.com on 6 Nov 2013 at 6:45

GoogleCodeExporter commented 9 years ago
I'm stuck on this bug for about 2 weeks. It's really a big headache for webtest 
projects.Maybe it's a bug from chrome, because there is not a good approach to 
capture the screenshot for chrome extensions. Those extensions just scroll the 
page and stitch the pieces together.
This bug, no matter it belongs to Chrome or WebDriver, really makes us into a 
rough way.

Original comment by mw5...@gmail.com on 7 Nov 2013 at 7:47

GoogleCodeExporter commented 9 years ago
After reading this and a number of other bug reports it seems the solution is 
simply to drop Chrome and use Firefox/HtmlUnit as there seems to be too many 
issues which aren't a priority before this can be fixed.

Original comment by n...@editd.com on 7 Nov 2013 at 3:45

GoogleCodeExporter commented 9 years ago
Hey, why did you close the bug, which was not fixed??? Can you see everyone 
need this functionality working?
Please, do something!

Original comment by dzvez...@getgoing.com on 8 Nov 2013 at 11:08

GoogleCodeExporter commented 9 years ago
The developers are reluctant in solving this bug and even in providing any 
updates for the same. Very disappointed to see such a behaviour from  such an 
active community. :(

Original comment by a...@wingify.com on 9 Nov 2013 at 7:17

GoogleCodeExporter commented 9 years ago
Issue 622 has been merged into this issue.

Original comment by kkania@chromium.org on 14 Nov 2013 at 6:03

GoogleCodeExporter commented 9 years ago
Issue 624 has been merged into this issue.

Original comment by kka...@google.com on 14 Nov 2013 at 8:55

GoogleCodeExporter commented 9 years ago
That's too bad

Original comment by wangm1...@gmail.com on 29 Nov 2013 at 5:06

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Please fix this bug ASAP

Original comment by ron.korl...@gmail.com on 11 Dec 2013 at 7:42

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
No news on this?

Original comment by tagliapi...@gmail.com on 3 Jan 2014 at 7:51

GoogleCodeExporter commented 9 years ago
Yes, please fix it.  Much appreciated.

Original comment by annonh...@gmail.com on 7 Jan 2014 at 9:48

GoogleCodeExporter commented 9 years ago
please pretty please need it for mobile tests

Original comment by AlexeiG1...@gmail.com on 14 Jan 2014 at 7:34

GoogleCodeExporter commented 9 years ago
There is a workaround: scroll the page using JavaScript and stitch together the 
screen shots.

Use `document.documentElement.offsetWidth` (and offsetHeight) to get the 
overall size of the page, then keep taking screenshots until 
`document.documentElement.offsetHeight - window.scrollY > 
document.documentElement.clientHeight` is false, and execute 
`window.scrollBy(0,document.documentElement.clientHeight)` after every screen 
shot to scroll the page.

Original comment by j...@jahewson.com on 14 Jan 2014 at 7:55

GoogleCodeExporter commented 9 years ago
If you're going to scroll and stitch, I've noticed that chromedriver may return 
from executeScript before actually scrolling.  If I send a second call to query 
for the scroll position, however, it appears to "flush" the previous command.  
Without that little trick, I was duplicating some portions of the viewport.

Original comment by nirvd...@gmail.com on 14 Jan 2014 at 8:09

GoogleCodeExporter commented 9 years ago
Scroll/stitch is not a real solution. All elements with fixed position would 
appear on each screenshot you take, you'll have JavaScript events firing that 
may result in changes to the page...

It's an ugly hack that's better than nothing, but not a solution.

Original comment by alex.kal...@creamtec.com on 14 Jan 2014 at 8:46

GoogleCodeExporter commented 9 years ago
Scroll/stitch didn't work properly for me in all the cases, most of the times 
its duplicating the patch.

Original comment by swapnil3...@gmail.com on 14 Jan 2014 at 9:08

GoogleCodeExporter commented 9 years ago
I know this is closed & I know it looks like nobody will work on this but ...

Please somebody get this working - we use this for our acceptance test & its 
really annoying pass all our acceptance tests but still find issues below the 
fold.

Thanks for all the great work so far.

Original comment by mail.gor...@gmail.com on 15 Jan 2014 at 9:08

GoogleCodeExporter commented 9 years ago
Reopening, since this problem still exists.

However we can't really fix it until some changes are made on the browser side 
(see https://code.google.com/p/chromium/issues/detail?id=45209).

Original comment by samu...@chromium.org on 3 Feb 2014 at 11:41

GoogleCodeExporter commented 9 years ago
Issue 643 has been merged into this issue.

Original comment by samu...@chromium.org on 3 Feb 2014 at 11:45

GoogleCodeExporter commented 9 years ago
For the love of automated testing please fix this issue asap :)

Original comment by charlieb...@gmail.com on 13 Feb 2014 at 10:48

GoogleCodeExporter commented 9 years ago
Issue 704 has been merged into this issue.

Original comment by craigdh@chromium.org on 14 Feb 2014 at 5:03

GoogleCodeExporter commented 9 years ago
By the moment, if you are using python bindings, you can review the next 
workaround (some variables are our project variable but can be easily replaced)

https://snipt.net/restrada/python-selenium-workaround-for-full-page-screenshot-u
sing-chromedriver-2x/

Original comment by rodrigo....@gmail.com on 22 Feb 2014 at 10:29

GoogleCodeExporter commented 9 years ago
I forgot mention it. The code use Python Image Library :)

Original comment by rodrigo....@gmail.com on 22 Feb 2014 at 10:31

GoogleCodeExporter commented 9 years ago
+1 to fix this issue ASAP and give it a high priority.
Please guys, we need your "vote" now.

Original comment by zabra...@gmail.com on 24 Feb 2014 at 6:53

GoogleCodeExporter commented 9 years ago
plz fix asap. thanks

Original comment by irfan.na...@gmail.com on 27 Feb 2014 at 6:19

GoogleCodeExporter commented 9 years ago
Same critical to me on auto testing!
Hope fix asap.

Original comment by shengree...@gmail.com on 5 Mar 2014 at 6:19

GoogleCodeExporter commented 9 years ago
Any Updates regarding same problem ?? 

Screenshot capture was working perfect in old version. So can you change driver 
code like it was before ??

Original comment by rudratri...@gmail.com on 8 Mar 2014 at 1:02

GoogleCodeExporter commented 9 years ago
Before this can be implemented in ChromeDriver, there need to be some changes 
made to Chromium first. If you're interested in updates you can follow the 
issue on the Chromium tracker:

https://code.google.com/p/chromium/issues/detail?id=45209

Unfortunately it is not simple so I'm not sure how long it will take to 
implement. There are a few cases that make this difficult, such as how to take 
a full screenshot of a page that uses parallax scrolling.

If you haven't already, feel free to star the issue to get updates as well as 
to let the developers know you're interested.

Original comment by samu...@chromium.org on 10 Mar 2014 at 5:44

GoogleCodeExporter commented 9 years ago
I think most of us are using chromedriver screenshot to get automated 
screenshots of WHOLE web pages. Now this is not the case. Please fix it as soon 
as possible.

Original comment by tuckdes...@yahoo.com on 22 Apr 2014 at 4:07

GoogleCodeExporter commented 9 years ago
I agree. If driver cannot get a fullpage screenshot, why should we use it?

Original comment by c...@ckada.com on 12 May 2014 at 10:53

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
any upates on this issue? plz fix asap thanks

Original comment by irfan.na...@gmail.com on 22 May 2014 at 10:53

GoogleCodeExporter commented 9 years ago
Any update?. ChromeDriver is the best webdriver in terms of performance and 
stability but this issue make it inviable for use in many cases.

Original comment by voyadomi...@gmail.com on 20 Jun 2014 at 11:15

GoogleCodeExporter commented 9 years ago
Just wondering if the development team intends to fix this issue / make this a 
feature. Or should we start modifying our test to do scrolling and taking 
screenshots?

Thanks.

Original comment by pd.l...@gmail.com on 27 Jun 2014 at 7:16

GoogleCodeExporter commented 9 years ago
Could you please fix this issue.
Thanks

Original comment by madhav.k...@gmail.com on 2 Jul 2014 at 1:29

GoogleCodeExporter commented 9 years ago
Please fix this one.  I have to use Firefoxdriver for this to work.

Original comment by philip.f...@sonydadc.com on 29 Jul 2014 at 7:29

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Please fix this as I'm starting to have crazy thoughts of using Firefox 
(AHHHHHH!!)

Original comment by getter....@gmail.com on 12 Aug 2014 at 10:32

GoogleCodeExporter commented 9 years ago
Everyone can use PhantomJs in the meantime, there even Selenium Phantom driver 
for this
http://phantomjs.org/screen-capture.html

Original comment by sevruk.g...@gmail.com on 12 Aug 2014 at 11:27

GoogleCodeExporter commented 9 years ago
Using a browser that isn't Chrome doesn't help anyone verifying results in 
Chrome, unfortunately.

Original comment by nirvd...@gmail.com on 12 Aug 2014 at 11:59

GoogleCodeExporter commented 9 years ago
PhantomJS is a good tool, however it does not support inline SVG filters

Original comment by yona...@stylls.com on 13 Aug 2014 at 4:54

GoogleCodeExporter commented 9 years ago
How did the first ChromeDriver worked? Was it some documented API for this? Can 
someone point to the source code of v1 ChromeDriver?

Original comment by sevruk.g...@gmail.com on 13 Aug 2014 at 9:55

GoogleCodeExporter commented 9 years ago
They've said multiple times that there's an issue on the Chromium side that 
needs to be fixed first, 
https://code.google.com/p/chromium/issues/detail?id=45209 . Apparently the hook 
that Chromedriver used to use doesn't exist as of Chrome 29. 

Original comment by xaen...@gmail.com on 13 Aug 2014 at 12:14

GoogleCodeExporter commented 9 years ago
Any updates on the resolution of this issue? 

Original comment by deepak.r...@gmail.com on 29 Oct 2014 at 3:06