selenium: [🐛 Bug]: Console Window Geckodriver since v4.6.0

What happened?

System

  • Version: geckodriver 0.32.0
  • Platform: Windows 11 / Python 3.9.13
  • Firefox: 108.0.1
  • Selenium: 4.6.0 and above

Testcase

After updating Selenium from 4.5.0 to any higher version the geckodriver console window cannot be hidden. ( using Pyinstaller with --noconsole and --onefile option )

I’ve tried various options in the code, but none seems to hide the console window

Using CREATE_NO_WINDOW worked until selenium v4.6.0:

service = Service( geckodriver )
service.creationflags = subprocess.CREATE_NO_WINDOW

Tried adding the code below, but without result options.add_argument('--disable-gpu')

flag = 0x08000000  # No-Window flag
webdriver.common.service.subprocess.Popen = functools.partial(webdriver.common.service.subprocess.Popen, creationflags=flag )
or webdriver.common.service.subprocess.Popen = functools.partial( subprocess.Popen, creationflags=flag )

How can we reproduce the issue?

Use selenium and make exe using Pyinstaller with --noconsole and --onefile options

Relevant log output

just a blank screen

Operating System

Windows 11

Selenium version

4.6.0+

What are the browser(s) and version(s) where you see this issue?

Firefox: 108.0.1

What are the browser driver(s) and version(s) where you see this issue?

Geckodriver 0.32.0

Are you using Selenium Grid?

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 15 (6 by maintainers)

Most upvoted comments

Thanks ! I can confirm changing self.creationflags to self.creation_flags made the geckodriver console window remain hidden.

@ReMiOS I don’t have a windows VM handy, but at a quick glance I will assume because this isn’t strictly ‘public API’ it was renamed to be pythonic as self.creation_flags and you are now using the old name which has no impact, python won’t error here either as it’ll bolt onto the instance. Can you please try with service.creation_flags = ... and I’m certain it will work as before.

Commit can be referenced here