New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 719900 link

Starred by 1 user

Issue metadata

Status: Duplicate
Merged: issue 714058
Owner: ----
Closed: May 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocking:
issue 705916



Sign in to add a comment

Blank screenshot for the macOS using headless chrome

Reported by ydv.rahu...@gmail.com, May 9 2017

Issue description

Chrome Version       : Version 60.0.3088.3 (Official Build) dev (64-bit)
URLs (if applicable) : www.facebook.com
Other browsers tested: None
  
     Safari: x
    Firefox: x
         IE: x

What steps will reproduce the problem?
(1) Run chrome headless using this tutorial - https://intoli.com/blog/running-selenium-with-headless-chrome/
(2) Check the screenshot in the project folder.

What is the expected result?
Screenshot is blank.


What happens instead?
Screenshot should be of the Facebook home page.

Please provide any additional information below. Attach a screenshot if
possible.

Screenshot is attached!

I am not able to get a screenshot of the Facebook page, as I would have expected. 

 
main-page-verify.png
81 bytes View Download
main-page.png
81 bytes View Download

Comment 1 by e...@chromium.org, May 9 2017

Components: -Blink UI>GFX
Labels: Proj-Headless
Not quite sure where Headless bugs belong, to UI-GFX for now. Also adding Proj-Headless label.

Cc: irisu@chromium.org jzfeng@chromium.org
Does anyone know if Selenium is setting fromSurface=true[1] when capturing the screenshot?

[1] https://chromedevtools.github.io/devtools-protocol/tot/Page/#method-captureScreenshot

Comment 3 by jzfeng@chromium.org, May 10 2017

No, chromedriver sends an empty params for Page.captureScreenshot.
See https://cs.chromium.org/chromium/src/chrome/test/chromedriver/chrome/web_view_impl.cc?type=cs&sq=package:chromium&l=512.

I tried to take screenshot of www.facebook.com using Selenium on my linux machine. The screenshot is correct, not blank. 
Labels: TE-NeedsTriageHelp
@zfeng@chromium.org - can you let me know which method you used to get the screenshot. I am using the get_screenshot_as_file() method, and I am getting a blank screenshot.

Comment 6 by jzfeng@chromium.org, May 10 2017

Yeah, I'm using get_screenshot_as_file as well. It is strange that it doesn't work for you. 

Have you tried other websites? I guess they are also blank?
jzfeng@chromium.org -> Yeah. It is no good for any other website. I tried the same thing with PhantomJS and I am able to take a screenshot. 

Comment 8 by jzfeng@chromium.org, May 10 2017

Would you mind try regular chrome, just remove 
options.add_argument('headless').

You should be able to see the chromium browser window and it should show facebook webpage and take the screenshot.

If you still see blank screenshot. Then the problem is not with headless.


I am able to take a normal screenshot using the normal browser screenshot code. I already tried this option. 
Then what about adding
options.add_argument('disable-gpu')?
jzfeng@chromium.org - Makes no difference at all. I ran with this chrome options

options = webdriver.ChromeOptions()
options.binary_location='chrome_location_on_my_system'
options.add_argument('headless')

options.add_argument('disable-gpu')
options.add_argument('window-size=1200x600')


Then what about run the commandline:
chrome_location_on_my_system --headless --window-size=1200x600 --screenshot https://www.facebook.com/?
Cc: dvallet@chromium.org
Labels: -TE-NeedsTriageHelp
I'm guessing https://codereview.chromium.org/2871113002/ will fix this problem.
jzfeng@chromium.org -> returns no screenshot at all. 
Sounds like this is a duplicate of https://bugs.chromium.org/p/chromium/issues/detail?id=714058.
Mergedinto: 714058
Status: Duplicate (was: Unconfirmed)

Sign in to add a comment