mozilla / geckodriver

WebDriver for Firefox
https://firefox-source-docs.mozilla.org/testing/geckodriver/
Mozilla Public License 2.0
7.03k stars 1.51k forks source link

Cannot Hide Geckodriver console window #2073

Closed ReMiOS closed 1 year ago

ReMiOS commented 1 year ago

System

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 )
whimboo commented 1 year ago

Geckodriver doesn't open a console at all. This is all done by Selenium. As you said it regressed after upgrading to a new Selenium version. As such please file an issue against Selenium.

ReMiOS commented 1 year ago

Thanks for your reply.

I've created an issue at Selenium: https://github.com/SeleniumHQ/selenium/issues/11465