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
EstimatedDays: ----
NextAction: ----
OS: Windows
Pri: 3
Type: Bug

Blocked on:
issue 686608

Sign in to add a comment

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

Reported by, 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:

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 import By
from import WebDriverWait 
from import expected_conditions as EC
import as ui
from 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"])
driver = webdriver.Chrome(chrome_options = options)


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?


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

Comment 1 by, Apr 19 2017

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

Comment 2 by, Apr 19 2017

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


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

Comment 3 by, Apr 20 2017

hi gmanikp,

i changed the headless flag line as you suggested; i've attached the
script,  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, Apr 20 2017

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

For more details visit - Your friendly Sheriffbot

Comment 5 by, 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, 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, Apr 21 2017

hi gmanikpure,

i'm also attaching the files here.

1.5 KB View Download
198 KB View Download

Comment 8 by, 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, May 17 2017

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

Comment 10 by, May 19 2017

hi dvallet,

file downloading still doesn't work in headless mode, though [at least with


Comment 11 by, 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, Jan 24

Components: Test>WebDriver

Comment 13 by, Jan 24

Components: -Tests>WebDriver

Sign in to add a comment