does not pass args capability to geckodriver
See original GitHub issueš Bug Report
I am unable to append options to the geckodriver
args capability via the desired_capabilities parameter.
To Reproduce
I am running this:
#!/usr/bin/env python
from selenium.webdriver import Firefox, DesiredCapabilities
import time
capabilities = DesiredCapabilities.FIREFOX.copy()
capabilities['args'] = ["-headless"]
print(capabilities)
webdriver = Firefox(desired_capabilities=capabilities)
webdriver.get("https://google.com")
while 1:
time.sleep(0.1)
Expected behavior
A headless instance visiting google.com
, as I gather from the docs: the -headless
string being one of the members of the args
array should mandate that headlessness.
Actual behavior
A visible window.
Test script or set of commands reproducing this issue
Provided above.
Environment
OS: Linux x86_64
Browser: Firefox
Browser version: Mozilla Firefox 88.0.1
Browser Driver version: geckodriver 0.29.0
Language Bindings version: Python
ās selenium 3.141.0
package
Additional info
I have that other types of args
are not passed either. For instance, capabilities['args'] = ["-profile", "<PATH-TO-EXISTING-PROFILE>"]
does not result in geckodriver
using that existing profile, as suggested by the docs that it should.
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Selenium node does not pass the command line arguments to ...
On versions 3.5.0 and higher, Selenium node does not pass the command line arguments to geckodriver. Expected Behavior -. If the node receivesĀ ......
Read more >How to pass command line arguments to the browser driver ...
I'm currently using protractor for some tests. Unfortunately, I can't figure out a way to pass ...
Read more >Configuring Selenium WebDriver | Serenity BDD Users Manual
The simplest way to configure the driver you want to use is in your project's serenity.conf file (which you will find in src/test/resources...
Read more >WebDriverManager - Boni GarcĆa
WebDriverManager is an open-source Java library that carries out the management (i.e., download, setup, and maintenance) of the drivers requiredĀ ...
Read more >Getting Started | Nightwatch.js
Everything you need in order to get started with Nightwatch.js, step-by-step, with configuration guides for various browsers.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
What you are after is going against how Selenium, and Geckodriver, do things in general. Selenium originally, and then geckodriver too, copy the profile so that if you pass it in that you get the same start point as always. We found that it was a major footgun to allow things to persist indefinitely as well as being a security issue if people share these profiles around.
If you want to get the resultant profile after running your automation code I suggest you do something like
The thing youāre trying to do is not how Selenium/Geckodriver was designed so youāre going to have to try be creative here.
@AutomatedTester Thank you: confirming that
Selenium
does not make this easy by default is at least a sanity check of sorts. I thought it was me missing some easy persistence switch.As to being creative, yes, I figured Iād have to cobble something togetherā¦ What Iāve settled on for now, since Iām specifically interested in cookies, is hard-linking the temp profileās
cookies.sqlite
file to a location of my choosing. Then, when it exits, writes the cookies to that database, releases the lock and then deletes it, I have the copy.Anyway, I think I can work with this. Thank you very much for all the help and the time you invested in this exchange.