Headless Mode issues with Chromedriver

681 views
Skip to first unread message

C Smith

unread,
Feb 9, 2023, 1:38:09 PM2/9/23
to ChromeDriver Users
When could we expect a fix for the issue with Download and User folder preferences in headless mode? 

Thank you,

-C Smith

C Smith

unread,
Feb 9, 2023, 10:16:44 PM2/9/23
to ChromeDriver Users
The workaround in the comments from this bug ticket seem to be working.  Not sure how that is letting us get past the issue... https://bugs.chromium.org/p/chromedriver/issues/detail?id=4357

C Smith

unread,
Feb 10, 2023, 10:01:12 PM2/10/23
to ChromeDriver Users

Another follow-up to my own post.  I'm seeing an issue where the --headless=new argument does not use the --window-size argument if the what Chrome sees as the screen resolution is smaller.  We are seeing this when running some cucumber tests through our Jenkins pipelines.  I'm also seeing this when manually running these cucumber features from a command line when remote desktopped into our test running system.  If I set my RD session to use a screen size smaller (800x600 for an extreme example) than the window-size argument, the Chrome sets itself up to use a work area the same size as my screen resolution.

From the Defaults: file in the working directory
"browser":{"check_default_browser":false,"window_placement":{"bottom":0,"left":0,"maximized":false,"right":0,"top":0,"work_area_bottom":560,"work_area_left":0,"work_area_right":800,"work_area_top":0}}

In my Selenium configuration options:

if TestBrowser == 'chrome'
  options = Selenium::WebDriver::Chrome::Options.new

  #Using Headless New Mode as the old headless mode is having problems.
  if UseHeadlessMode == 'true'
    options.add_argument('--headless=new')
  end

  options.add_argument('--start-maximized')
  options.add_argument('--disable-popup-blocking')
  options.add_argument('--disable-extensions')
  options.add_argument('--window-size=1960,1080')
  options.add_argument('--disable-features=VizDisplayCompositor')
  #options.add_argument('--enable-logging')
  #options.add_argument('--v=1')
  options.add_argument('--user-data-dir=C:\FourthTest')

I've been messing around with different options, like not using the --start-maximized, but nothing is really working the way the old headless mode used to work in regards to using the window-size parameters.

Reply all
Reply to author
Forward
0 new messages