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

Issue metadata

Status: WontFix
Owner: ----
Closed: Jul 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 3
Type: Bug

Blocked on:
issue 686608



Sign in to add a comment
link

Issue 712981: Selenium -- headless isn't headless (Windows 10)

Reported by david.ha...@gmail.com, Apr 19 2017

Issue description

Chrome Version       : 59.0.3071.9 (Official Build) dev (64-bit)
URLs (if applicable) : N/A
Other browsers tested:
  Add OK or FAIL, along with the version, after other browsers where you
have tested this issue:
     Safari:
    Firefox:
         IE:

Hi, I've written a test module in python to visit a website, click on a couple of links, and then download the PDF to whose URL i've navigated,  i am using selenium with chromedriver (latest version).  it works perfectly when i use the browser in normal (visible) mode.  now i'm trying to do the same thing with the browser running in headless mode.  i initialize the browser as follows:

from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait 
from selenium.webdriver.support import expected_conditions as EC
import selenium.webdriver.support.ui as ui
from selenium.webdriver.chrome.options import Options

options = webdriver.ChromeOptions()

prefs = {"download.default_directory": "D:/projects/getpdf/src/chromeTest", "plugins.always_open_pdf_externally": True,
		 "disable-extensions": True, "download.prompt_for_download": False, "download.directory_upgrade": True}
options.add_experimental_option("prefs", prefs)
options.add_experimental_option("args", ["--headless"])
options.add_argument("disable-infobars")
driver = webdriver.Chrome(chrome_options = options)

driver.get("https://www.ncbi.nlm.nih.gov/pubmed/25988229")
...

the expected result occurs -- eventually the PDF gets downloaded -- but the browser is visible, not headless, and looks and behaves exactly the same as when i omit the line
options.add_experimental_option("args", ["--headless"]).

from the docs, this appears to be the right way to start chrome in headless mode, so what am i doing wrong?

-dh


What is the expected result?

that chrome would open invisibly; the proof of its existence would be the appearance of the PDF i'm downloading.


What happens instead?

the PDF gets downloaded, so chrome is functioning properly, but it is visible, not invisible.

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

Comment 1 by pbomm...@chromium.org, Apr 19 2017

Components: Tests>WebDriver
Labels: M-59 OS-Windows

Comment 2 by gmanikpure@chromium.org, Apr 19 2017

Labels: Needs-Feedback
david@, please pass the '--headless' command line flag in following manner:-

options.add_argument("headless")

Let us know how this goes. If you still reproduce the issue, please share Chromedriver verbose logs.

Comment 3 by david.ha...@gmail.com, Apr 20 2017

hi gmanikp,

i changed the headless flag line as you suggested; i've attached the
script, playWithSelenium.py.  if you run it, you should see in the "dfd"
directory (which you can reset to your local directory of choice) the log
file and a 1180 KB pdf.  the goal is to get the pdf to show up without
seeing the browser appear.  in addition to the script, i've attached the
log file i got with the --verbose argument.

when i run it, the PDF appears as expected, and the driver closes normally,
but the browser window is visible (exactly as if i'd omitted the
options.add_argument('headless') line).

please advise, and thanks.

-david haynor

Comment 4 by sheriffbot@chromium.org, Apr 20 2017

Project Member
Cc: gmanikpure@chromium.org
Labels: -Needs-Feedback
Thank you for providing more feedback. Adding requester "gmanikpure@chromium.org" to the cc list and removing "Needs-Feedback" label.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot

Comment 5 by gmanikpure@chromium.org, Apr 20 2017

david@, thanks for trying out the suggestion given in comment#2. But attachments are missing. Can you please attach it again?

Comment 6 by skyos...@chromium.org, Apr 20 2017

Blockedon: 686608
Status: Available (was: Unconfirmed)
The Windows patch for --headless hasn't quite landed yet. Please keep an eye on  bug 686608 .

Comment 7 by david.ha...@gmail.com, Apr 21 2017

hi gmanikpure,

i'm also attaching the files here.

-dh
playWithSelenium.py
1.5 KB View Download
cdLog.txt
198 KB View Download

Comment 8 by gmanikpure@chromium.org, Apr 22 2017

thanks david, but as mentioned in comment#6, work is in progress for headless feature on Windows. Please follow  bug 686608  for more details.

Comment 9 by dvallet@chromium.org, May 17 2017

crbug/686608 has been fixed now and --headless flag should run as expected in Windows as of M60

Comment 10 by david.ha...@gmail.com, May 19 2017

hi dvallet,

file downloading still doesn't work in headless mode, though [at least with
selenium/chromedriver].

-dh

Comment 11 by eseckler@chromium.org, Jul 17 2017

Status: WontFix (was: Available)
Support for file downloading is tracked in bug 696481. Closing this, since headless support on windows should be available in M60 now.

Comment 12 by estaab@chromium.org, Jan 24

Components: Test>WebDriver

Comment 13 by estaab@chromium.org, Jan 24

Components: -Tests>WebDriver

Sign in to add a comment