Open JasonRhoades opened 5 years ago
maybe related to this https://github.com/mozilla/geckodriver/issues/1559 and your firefox DOA
is this issue currently open or do we have something to work around ?
Not sure if it's related (looks like our environments are very different) but I was having a similar issue in Python. When trying to instantiate a Firefox driver with a specified profile dir, it would hang, and eventually fail with "Exiting due to channel error" written to geckodriver.log
. When running exactly the same code without specifying a profile dir (so a random, temporary one is created), it ran fine.
After a lot of searching I came across this comment in another thread:
it's a problem with the custom profile. You will have to add a fixed Marionette port to the profile's preferences (prefs.js) and then force geckodriver via services args to make connect to that port.
Sure enough, once I specified a port for Marionette, starting up with a specified profile just started working :star2: For me, this meant adding the following to my instantiation of the driver:
opts = FirefoxOptions()
opts.add_argument("-profile")
opts.add_argument(str(PROFILE_LOCATION)]:
driver = Firefox(
executable_path=DRIVER_EXECUTABLE_PATH,
options=opts,
service_args=["--marionette-port", "2828"], # <-- This was the key part I was missing
)
In fairness, if I had been more attentive in copying the code for specifying the profile to use from the docs in the first place, I wouldn't have encountered the issue :man_shrugging:
Would love to know why. Per that comment I had a look in the prefs.js
of a couple of the profiles I was trying to use. The only mention of Marionette in there was the line user_pref("marionette.enabled", true);
Presumably if one doesn't specify a profile, then some part of the stack (Selenium? geckodriver
itself?) creates the temporary profile and wires up a Marionette port automatically... would be nice if it did that also when specifying a custom profile which doesn't otherwise specify a Marionette port.
Anyway, hope this might help you out :sun_with_face: Would be interested to see what the JS equivalent looks like.
Bug report
6.9.0
5.4.2
7.3.8
Firefox v67
Linux - Fedora 29
For our application, we need to have a specific addon running in Firefox. To do this, we set it up in the default profile, and then try to run the tests. However, when the profile argument is present, while Firefox is launched, webdriver never manages to connect to it.
Running against Selenium server, the following console output appears:
However, when the -P "Default" argument is removed, Firefox launches and the test goes through successfully:
This also happens running with DirectConnect. Running with a profile and the given add-on actually does work with Chrome, but we have a requirement to test against Firefox.
config.ts: