-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support headless configuration for Firefox in selenium-webdriver package #4591
Comments
This option should be added to all language binding. |
Implemented in Java binding by 38a5130 |
As far as I can tell, this is already possible with the Ruby bindings: options = Selenium::WebDriver::Firefox::Options.new(
args: ['-headless']
)
Selenium::WebDriver.for :firefox, options: options |
@franzliedke yes it is most likely possible with all bindings, but this is asking for a shortcut without having to specify it in args |
Right, note that Chrome already supports this configuration in selenium-webdriver: selenium/javascript/node/selenium-webdriver/chrome.js Lines 39 to 51 in 18660c4
And selenium-webdriver also provides an example script using it: Although strangely the docs don't mention it: This issue is about doing the same for Firefox. It may be merely syntactic sugar, but it's useful nonetheless. |
Thanks for clarification. I sent a PR for the Ruby bindings: #4762. |
Added to python in 1d490b4 |
dotnet please! 🙏 |
I’m hoghly disinclined to implement this for .NET. It was a mistake for other bindings to implement it as well. The ability to add commmsnd line arguments to both Firefox and Chrome is there already; use the |
@jimevans I see this as a case of the API can expose a common config option without requiring users to be intimately familiar with a browser's command line arguments. It's not unlike having strongly typed APIs for capabilities vs. expecting users to know all of the various key/value pairs. |
I understand the analogy, @jleyba, I just don’t think I agree with it. Capabilities are a much smaller finite set of settings. To me, it’s really hard to justify adding an API for a single command line argument while ignoring the potentially dozens of others. |
Closing as it was resolved after reading the comments. |
OS: Windows, macOS, Linux
Selenium Version: 3.5.0
Browser: Firefox
Browser Version: 56
Once Firefox supports headless mode on all three platforms (starting with Firefox 56, currently in beta and due to be released next month), the selenium-webdriver package should support configuring Firefox to run headlessly the same way it supports Chrome running headlessly, via a
headless()
method on the Firefox driver's Options class, so that you can drive Firefox headlessly via:(It would additionally be useful to be able to set the headless window's size via the equivalent of Chrome's
windowSize({width, height})
method.)The text was updated successfully, but these errors were encountered: