Issue metadata
Sign in to add a comment
|
Blank screenshot for the macOS using headless chrome
Reported by
ydv.rahu...@gmail.com,
May 9 2017
|
||||||||||||||||||||||||
Issue descriptionChrome 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.
,
May 9 2017
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
,
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.
,
May 10 2017
,
May 10 2017
@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.
,
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?
,
May 10 2017
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.
,
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.
,
May 10 2017
I am able to take a normal screenshot using the normal browser screenshot code. I already tried this option.
,
May 10 2017
Then what about adding
options.add_argument('disable-gpu')?
,
May 10 2017
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')
,
May 10 2017
Then what about run the commandline: chrome_location_on_my_system --headless --window-size=1200x600 --screenshot https://www.facebook.com/?
,
May 10 2017
I'm guessing https://codereview.chromium.org/2871113002/ will fix this problem.
,
May 10 2017
jzfeng@chromium.org -> returns no screenshot at all.
,
May 11 2017
Sounds like this is a duplicate of https://bugs.chromium.org/p/chromium/issues/detail?id=714058.
,
May 11 2017
|
|||||||||||||||||||||||||
►
Sign in to add a comment |
|||||||||||||||||||||||||
Comment 1 by e...@chromium.org
, May 9 2017Labels: Proj-Headless