Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upGeckodriver can't connect to Marionette if custom profile via local path is in use #1058
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
whimboo
Nov 15, 2017
Collaborator
So when you log into the node, can you see that Firefox is getting started at all? I would expect at least the Firefox log to be present in the trace log. I assume you followed https://firefox-source-docs.mozilla.org/testing/geckodriver/geckodriver/TraceLogs.html?
|
So when you log into the node, can you see that Firefox is getting started at all? I would expect at least the Firefox log to be present in the trace log. I assume you followed https://firefox-source-docs.mozilla.org/testing/geckodriver/geckodriver/TraceLogs.html? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
andreastt
Nov 15, 2017
Member
I am also surprised to not find any stdout output from Firefox after the Running command: … log line. If you see connection attempt going up to 600 and then timing out, it means geckodriver is either unable to launch Firefox or that it is unable to connect to the Marionette remote protocol in the Firefox that gets started.
|
I am also surprised to not find any stdout output from Firefox after the |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
2mf
Nov 16, 2017
I'm having the same issue with Selenium 3.7.0 and geckodriver 0.19.1.
However in my case firefox is starting and geckodriver can't connect to firefox.
When I use the geckodriver 0.18.0 it is working again.
2mf
commented
Nov 16, 2017
|
I'm having the same issue with Selenium 3.7.0 and geckodriver 0.19.1. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
soosrol
Nov 16, 2017
@whimboo, @andreastt:
Yes, if I log into the node, I can see Firefox starting up, and it's responsive, I can interact with it manually. But somehow Geckodriver can't connect. If I don't try to load the profile, it usually connects on the 2nd-3rd try.
I'll see if I can squeeze out more log detailed logs, but I'm already using {"moz:firefoxOptions": {"log": {"level": "trace"}}}. Is there a separate Firefox log file somewhere? Currently I'm getting these logs from the hub/node's console out.
soosrol
commented
Nov 16, 2017
|
@whimboo, @andreastt: |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
soosrol
Nov 16, 2017
@2mf:
Firefox starts for me too, but geckodriver can't connect. I'll check if it works with v0.18. Are you also trying to load a profile with command line args, or just starting FF normally?
EDIT:
Checked with geckodriver v0.18, no difference.
soosrol
commented
Nov 16, 2017
•
|
@2mf: EDIT: |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
whimboo
Nov 17, 2017
Collaborator
@soosrol, does Firefox in those failing cases show the robot in the location bar? Also have a look at the browser console (tools menu) if there are some errors reported for Marionette.
Regarding the logs, usually all output should (for the time being) end up in the same log file. But I don't know anything about the remove driver to give a qualified answer in how it works.
|
@soosrol, does Firefox in those failing cases show the robot in the location bar? Also have a look at the browser console (tools menu) if there are some errors reported for Marionette. Regarding the logs, usually all output should (for the time being) end up in the same log file. But I don't know anything about the remove driver to give a qualified answer in how it works. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
soosrol
Nov 17, 2017
@whimboo, yes, it has the robot in the address bar. Also checked the browser console, and as far as I can tell, it doesn't have any relevant errors. See attached screenshots.
soosrol
commented
Nov 17, 2017
|
@whimboo, yes, it has the robot in the address bar. Also checked the browser console, and as far as I can tell, it doesn't have any relevant errors. See attached screenshots. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
2mf
Nov 20, 2017
@soosrol I'm loading a profile in a few cases but most cases do not use profiles at all.
What I'm doing is running Firefox headless or within Xvfb inside a docker container.
2mf
commented
Nov 20, 2017
|
@soosrol I'm loading a profile in a few cases but most cases do not use profiles at all. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
whimboo
Nov 20, 2017
Collaborator
@soosrol interesting! It reminds me on a case we occasionally see in our automated tests but which is so seldom that I wasn't able to hit it so far.
Is that reproducible for you all the time? Does it also happen when you are not creating a new profile but let geckodriver do it? I would like to know what the minimal testcase is for you.
Also I would like to see a real trace level log. Would be fantastic if you can find out where this is stored on the hub.
Btw. is that a new issue you are facing with the 57 release, or did it already exist with 56?
|
@soosrol interesting! It reminds me on a case we occasionally see in our automated tests but which is so seldom that I wasn't able to hit it so far. Is that reproducible for you all the time? Does it also happen when you are not creating a new profile but let geckodriver do it? I would like to know what the minimal testcase is for you. Also I would like to see a real trace level log. Would be fantastic if you can find out where this is stored on the hub. Btw. is that a new issue you are facing with the 57 release, or did it already exist with 56? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
soosrol
Nov 20, 2017
@whimboo I can reproduce it every time. Everything works flawlessly if I don't specify a profile to load. This has been the same ever since I first tried it 2-3 Firefox versions ago and since Selenium 3.4 and geckodriver 17 or so...
What's really strange, is that I only encounter this issue if I pass in the command line arg for loading the profile from local drive. If I generate/load the profile within my tests by using
FirefoxProfile profile = new FirefoxProfile(new File("path/to/profile"));
FirefoxOptions options = new FirefoxOptions();
options.setProfile(profile);
capabilities.setCapability(FirefoxOptions.FIREFOX_OPTIONS, options);
the profile gets loaded and and the session is started without an issue.
You may ask why I'm not doing it this way, and the answer is simple: I am running my tests on Selenium grid on multiple threads and this would require me to have selenium transfer the profile upon every browser start/restart. My custom profile contains a browser extension, that is ~20MB in size. Having a profile of this size transferred by selenium grid is not just very slow, but also very fragile, as after 2-3 tries I always get Java heap space exception, regardless of the allowed memory in JVM settings.
soosrol
commented
Nov 20, 2017
|
@whimboo I can reproduce it every time. Everything works flawlessly if I don't specify a profile to load. This has been the same ever since I first tried it 2-3 Firefox versions ago and since Selenium 3.4 and geckodriver 17 or so... What's really strange, is that I only encounter this issue if I pass in the command line arg for loading the profile from local drive. If I generate/load the profile within my tests by using
the profile gets loaded and and the session is started without an issue. You may ask why I'm not doing it this way, and the answer is simple: I am running my tests on Selenium grid on multiple threads and this would require me to have selenium transfer the profile upon every browser start/restart. My custom profile contains a browser extension, that is ~20MB in size. Having a profile of this size transferred by selenium grid is not just very slow, but also very fragile, as after 2-3 tries I always get Java heap space exception, regardless of the allowed memory in JVM settings. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
whimboo
Nov 27, 2017
Collaborator
Thank you for the update @soosrol. It looks great to have a reduced testcase now. One thing you could help us with is, can you please try if you can get the same issue reproduced when not running the test on the hub but locally? Does that produce the same failure?
Otherwise, @andreastt do you have an idea? Without having trace logs for that problem, I'm meanwhile out of ideas.
|
Thank you for the update @soosrol. It looks great to have a reduced testcase now. One thing you could help us with is, can you please try if you can get the same issue reproduced when not running the test on the hub but locally? Does that produce the same failure? Otherwise, @andreastt do you have an idea? Without having trace logs for that problem, I'm meanwhile out of ideas. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
soosrol
Nov 28, 2017
@whimboo: I've tried running the same comparison (starting with/without the profile arg) on my local machine and I got the exact same results. I think this rules out most of the environmental causes, as my local machine is a Mac, unlike my grid that runs on Windows VMs.
See attached logs for both sessions:
Without profile arg: good_ff.log
With profile arg: bad_ff.log
Selenium version: 3.7.1
Geckodriver version: 19.1
Firefox version: 57.0 (64-bit)
soosrol
commented
Nov 28, 2017
|
@whimboo: I've tried running the same comparison (starting with/without the profile arg) on my local machine and I got the exact same results. I think this rules out most of the environmental causes, as my local machine is a Mac, unlike my grid that runs on Windows VMs. See attached logs for both sessions: Selenium version: 3.7.1 |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
whimboo
Nov 29, 2017
Collaborator
Amazing to see. It means we are getting closer! Given those results I took the opportunity and had a look myself. Here the results...
When trying to use an already existent profile the profiles key in moz:firefoxOptions cannot be used. It indeed only supports base64 encoded profile data. But as our documentation says: To have geckodriver pick up an existing profile on the filesystem, please set the args field to {"args": ["-profile", "/path/to/your/profile"]}
So I tried to use args and passed-in the path to a specific profile directory. Firefox launches, by using this profile but we are not able to make any connection to Marionette even it is running. After the connection failure the test quits without killing the Firefox instance. I will continue diving deeper into that...
@soosrol can you please also test the args key. Do you get the correct profile loaded? Or do you have the same connection problems?
|
Amazing to see. It means we are getting closer! Given those results I took the opportunity and had a look myself. Here the results... When trying to use an already existent profile the So I tried to use @soosrol can you please also test the |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
whimboo
Nov 29, 2017
Collaborator
The problem with not being able to make a connection to Marionette for the given profile path is, that by default Marionette uses port 2828, but geckodriver takes a random free port. Right now I do not see a way to allow pass-in a fixed port to geckodriver when not starting it manually. Checking the code I can only see that the command line argument --marionette-port gets evaluated.
So whether we need a capability under moz:firefoxOptions to let users specify a port for Marionette, or geckodriver would have to update the prefs.js file first with the wanted port before starting Firefox. @andreastt what do you think?
|
The problem with not being able to make a connection to Marionette for the given profile path is, that by default Marionette uses port 2828, but geckodriver takes a random free port. Right now I do not see a way to allow pass-in a fixed port to geckodriver when not starting it manually. Checking the code I can only see that the command line argument So whether we need a capability under |
whimboo
changed the title from
Geckodriver can't connect to Firefox when loading profile from local file system
to
Geckodriver can't connect to Marionette if custom profile via local path is in use
Nov 29, 2017
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
soosrol
Nov 29, 2017
@whimboo: Yes, the args works, that is how I am loading the profile. The correct profile gets loaded both on Windows/Mac, regardless if I do it with the grid or locally.
In my opinion you may have just found the root cause with the marionette port!
When I don't specify the profile and let it be generated for the session, I can see on about:config that the port was set via prefs.js. However, when loading my profile with -profile, it shows as default just like you said.
At this point I'm trying to see if I can somehow force the geckodriver --marionette-port command line parameter from either the code or some config.
soosrol
commented
Nov 29, 2017
|
@whimboo: Yes, the In my opinion you may have just found the root cause with the marionette port! When I don't specify the profile and let it be generated for the session, I can see on At this point I'm trying to see if I can somehow force the geckodriver |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
whimboo
Nov 29, 2017
Collaborator
I will file a bug soon so that it can be fixed.
As workaround you could start geckodriver manually by passing in --marionette-port 2828 or whatever you have in the profile setup. Sadly there is no other way possible right now.
|
I will file a bug soon so that it can be fixed. As workaround you could start geckodriver manually by passing in |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
soosrol
Nov 29, 2017
Yes, that worked. I ended up pointing webdriver.gecko.driver to a shell script like this:
#!/bin/bash
path/to/geckodriver "$@" --marionette-port 2828
soosrol
commented
Nov 29, 2017
|
Yes, that worked. I ended up pointing
|
whimboo
added
the
geckodriver
label
Nov 29, 2017
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
whimboo
Nov 29, 2017
Collaborator
Bug 1421766 is now taking care of it.
Thank you for reporting! We really wonder why no-one else has seen this yet.
|
Bug 1421766 is now taking care of it. Thank you for reporting! We really wonder why no-one else has seen this yet. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
And good to know that there is a workaround at least. |
whimboo
referenced this issue
Nov 30, 2017
Closed
Login Prompt appears even when password is saved FF 56.02 Geckodriver 19.1 #1051
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
stewart-r
Dec 8, 2017
Any chance someone could clarify the workaround steps for this? I'm using the selenium standalone-firefox-debug docker container and selenium remote webdriver on .NET
I tried specifying --marionette-port 2828 in options.AddArgument and can see from the container logs that it is being passed to the CLI:
1512734718509 mozrunner::runner INFO Running command: "/usr/bin/firefox" "-marionette" "--profile /home/seluser/.mozilla/firefox/5vgqsnyv.default/" "--marionette-port 2828"
but I still have the same behaviour. I'm not at all sure how to check which port is in the profile setup? :-/ I'm not too familiar with selenium or geckodriver and feel like I am missing the point.
stewart-r
commented
Dec 8, 2017
|
Any chance someone could clarify the workaround steps for this? I'm using the selenium standalone-firefox-debug docker container and selenium remote webdriver on .NET I tried specifying
but I still have the same behaviour. I'm not at all sure how to check which port is in the profile setup? :-/ I'm not too familiar with selenium or geckodriver and feel like I am missing the point. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
stewart-r
Dec 8, 2017
Ah i understand now... In case anyone else was struggling in the same way as I was the --marionette-port command line option is applied when starting geckodriver not starting firefox.
So workaround steps are:
- rename /usr/bin/geckodriver to /usr/bin/geckodriver2
- use @soosrol 's script to point to the renamed executable file and save this script in the original /usr/bin/geckodriver location
Many thanks for the workaround, guys! All back up and running now :-)
stewart-r
commented
Dec 8, 2017
|
Ah i understand now... In case anyone else was struggling in the same way as I was the So workaround steps are:
Many thanks for the workaround, guys! All back up and running now :-) |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
phandinhloc
Dec 11, 2017
I got the same issue. Specifying the marionette port makes it very difficult to write the tests that start multiple firefox profiles at the same time.
phandinhloc
commented
Dec 11, 2017
•
|
I got the same issue. Specifying the marionette port makes it very difficult to write the tests that start multiple firefox profiles at the same time. |
This was referenced Jan 8, 2018
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
usmanpasha
Jan 23, 2018
FAILED CONFIGURATION: @BeforeClass beforeMethod
org.openqa.selenium.WebDriverException: org.apache.http.conn.HttpHostConnectException: Connect to localhost:32703 [localhost/0:0:0:0:0:0:0:1] failed: Connection refused (Connection refused)
Build info: version: '3.7.0', revision: '2321c73', time: '2017-11-02T22:22:35.584Z'
System info: host: 'MV-IMAGE-E17-8.local', ip: '2001:f40:902:a86d:4920:6e2e:35df:85c6', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.12.6', java.version: '1.8.0_131'
Driver info: driver.version: FirefoxDriver
usmanpasha
commented
Jan 23, 2018
|
FAILED CONFIGURATION: @BeforeClass beforeMethod |
namedgraph
referenced this issue
Jan 28, 2018
Closed
Selenium node does not pass the command line arguments to geckodriver #4730
hornschorsch
referenced this issue
Jan 31, 2018
Closed
Selenium::Remote::Driver->new( profile => 'path/to/file/' ) not working #365
whimboo
referenced this issue
Feb 12, 2018
Closed
Cannot launch with existing profile: Unable to read profile preferences file #1169
nenadalm
referenced this issue
Feb 15, 2018
Closed
Running mulltiple instances of firefox with custom profile #118
estute
referenced this issue
Mar 22, 2018
Merged
upgrade Jenkins to Firefox 59, geckodriver 0.20 #4408
javierlopez111
referenced this issue
Apr 12, 2018
Closed
Not able to use an existing FF profile using GeckoDriver 20, FF 58/59, WIN10 #1242
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
oneumyvakin
May 18, 2018
For applying workaround on Windows I've used following Go code:
package main
import (
"os"
"os/exec"
"fmt"
)
func main() {
var args []string = os.Args[1:]
args = append(args, "--marionette-port")
args = append(args, "2828")
cmd := exec.Command(
"geckodriver2.exe",
args...,
)
fmt.Println(args)
err := cmd.Run()
if err != nil {
fmt.Printf("failed to execute '%s' '%s': %s\r\n", cmd.Path, cmd.Args, err)
return
}
}
oneumyvakin
commented
May 18, 2018
|
For applying workaround on Windows I've used following Go code:
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
whimboo
May 18, 2018
Collaborator
Well, the actual workaround for now in case you are using the Python bindings will look like the following:
profile = tempfile.mkdtemp(".selenium")
opts = Options()
opts.binary = binary
opts.add_argument("-profile")
opts.add_argument(profile)
capabilities = DesiredCapabilities.FIREFOX.copy()
driver = webdriver.Firefox(options=opts,
capabilities=capabilities,
service_args=["--marionette-port", "2828"])
Other bindings should also expose the given options and the services_args argument.
|
Well, the actual workaround for now in case you are using the Python bindings will look like the following:
Other bindings should also expose the given options and the |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
alkayata
Jun 12, 2018
I've found same problem with selenium 3.12, firefox 60.1 and geckodriver 0.20.1
The workaround worked fine.
alkayata
commented
Jun 12, 2018
|
I've found same problem with selenium 3.12, firefox 60.1 and geckodriver 0.20.1 |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
abalfour
Jun 21, 2018
@stewart-r Thank you for the tips!
Unfortunately I'm still struggling to get this working. Is the shell script being saved as a .sh, or is there a way to convert this to an .exe instead? When I run my program it seems that the Selenium driver is still looking for geckodriver.exe at the original location and isn't invoking the script that I've left in its place. I assume if I were to just leave the original geckodriver.exe in the original location that Selenium would just run that rather than invoking the .sh.
Also, does adding Ooptions.AddArgument($"--marionette-port 2828"); not do anything at all, or is that also necessary for the fix to work?
abalfour
commented
Jun 21, 2018
|
@stewart-r Thank you for the tips! Unfortunately I'm still struggling to get this working. Is the shell script being saved as a .sh, or is there a way to convert this to an .exe instead? When I run my program it seems that the Selenium driver is still looking for geckodriver.exe at the original location and isn't invoking the script that I've left in its place. I assume if I were to just leave the original geckodriver.exe in the original location that Selenium would just run that rather than invoking the .sh. Also, does adding |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
whimboo
Jun 22, 2018
Collaborator
@abalfour please see my last comment. It explains it in Python but should be similar for other Selenium bindings.
|
@abalfour please see my last comment. It explains it in Python but should be similar for other Selenium bindings. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
alkayata
Jun 22, 2018
alkayata
commented
Jun 22, 2018
|
@abalfour. It seems you are using windows. You can tell selenium to
look for the geckodriver executable like this: "java
-Dwebdriver.gecko.driver='path to your geckodriver executable' -jar
./selenium-server-standalone-3.12.0.jar". Don't forget to use the -D
flag before the -jar or it doesn't work.
Besides, I think if you want to use a shell script in Windows, you
need to use a .bat file. So taking that into account, to start the
selenium server you should use something like that: "java
-Dwebdriver.gecko.driver='path to your geckodriver executable.BAT' -jar
./selenium-server-standalone-3.12.0.jar"
Last, you need to adapt your shell script to Windows. The one provided
works with bash, a command interpreter for unix, mainly linux. What it
does is to spawn a geckodriver instance passing the parameters given to
the script to it. For example, if I call 'geckodriver.sh -watermellon',
it will in turn call 'geckodriver -watermellon --marionette-port 2828'
. The '@' sign is the equivalente for 'all arguments passed to the
script'. So you need to find the way to do the same in windows. I don't
think it will be hard.
I hope it works
El jue, 21-06-2018 a las 22:24 +0000, Adrian Balfour escribió:
… @stewart-r Thank you for the tips!
Unfortunately I'm still struggling to get this working. Is the shell
script being saved as a .sh, or is there a way to convert this to an
.exe instead? When I run my program it seems that the Selenium driver
is still looking for geckodriver.exe at the original location and
isn't invoking the script that I've left in its place. I assume if I
were to just leave the original geckodriver.exe in the original
location that Selenium would just run that rather than invoking the
.sh.
Also, does adding Ooptions.AddArgument($"--marionette-port 2828");
not do anything at all, or is that also necessary for the fix to
work?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.
***@***.******@***.***":"EmailMessage","potentialActi
***@***.***":"ViewAction","target":"https://github.com/mozilla/geckod
river/issues/1058#issuecomment-
399262245","url":"#1058#
issuecomment-399262245","name":"View Issue"},"description":"View this
Issue on
***@***.***":"Organization","name":"GitHub","url":"ht
tps://github.com"}}
{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c5
5493e4bb","name":"GitHub"},"entity":{"external_key":"github/mozilla/g
eckodriver","title":"mozilla/geckodriver","subtitle":"GitHub
repository","main_image_url":"https://assets-cdn.github.com/images/em
ail/message_cards/header.png","avatar_image_url":"https://assets-
cdn.github.com/images/email/message_cards/avatar.png","action":{"name
":"Open in
GitHub","url":"https://github.com/mozilla/geckodriver"}},"updates":{"
***@***.*** in #1058: @stewart-r
Thank you for the tips! \r\n\r\nUnfortunately I'm still struggling to
get this working. Is the shell script being saved as a .sh, or is
there a way to convert this to an .exe instead? When I run my program
it seems that the Selenium driver is still looking for
geckodriver.exe at the original location and isn't invoking the
script that I've left in its place. I assume if I were to just leave
the original geckodriver.exe in the original location that Selenium
would just run that rather than invoking the .sh.\r\n\r\nAlso, does
adding `Ooptions.AddArgument($\"--marionette-port 2828\");` not do
anything at all, or is that also necessary for the fix to
work?"}],"action":{"name":"View
Issue","url":"#1058 (comment)
ecomment-399262245"}}}
{
***@***.***": "MessageCard",
***@***.***": "http://schema.org/extensions",
"hideOriginalBody": "false",
"originator": "AF6C5A86-E920-430C-9C59-A73278B5EFEB",
"title": "Re: [mozilla/geckodriver] Geckodriver can't connect to
Marionette if custom profile via local path is in use (#1058)",
"sections": [
{
"text": "",
"activityTitle": "**Adrian Balfour**",
"activityImage": "https://assets-cdn.github.com/images/email/message_
cards/avatar.png",
"activitySubtitle": ***@***.***",
"facts": [
]
}
],
"potentialAction": [
{
"name": "Add a comment",
***@***.***": "ActionCard",
"inputs": [
{
"isMultiLine": true,
***@***.***": "TextInput",
"id": "IssueComment",
"isRequired": false
}
],
"actions": [
{
"name": "Comment",
***@***.***": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\":
\"IssueComment\",\n\"repositoryFullName\":
\"mozilla/geckodriver\",\n\"issueId\": 1058,\n\"IssueComment\":
\"{{IssueComment.value}}\"\n}"
}
]
},
{
"name": "Close issue",
***@***.***": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"IssueClose\",\n\"repositoryFullName\":
\"mozilla/geckodriver\",\n\"issueId\": 1058\n}"
},
{
"targets": [
{
"os": "default",
"uri": "#1058 (comment)
nt-399262245"
}
],
***@***.***": "OpenUri",
"name": "View on GitHub"
},
{
"name": "Unsubscribe",
***@***.***": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"MuteNotification\",\n\"threadId\":
276678876\n}"
}
],
"themeColor": "26292E"
}
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
hornschorsch
commented
Jun 27, 2018
|
Is there any chance that this bug will be corrected some time? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
umarch06
Jun 30, 2018
@alkayata can you please suggest me solution for C#, here is what I am doing but browser doesn't do anything just open and then no action is performed.
FirefoxOptions firefoxOptions = new FirefoxOptions();
firefoxOptions.AddArgument("-profile " + Configuration.BrowserProfilePath);
firefoxOptions.AddArgument("--marionette-port " + "2828");
PropertiesCollection.Driver = new FirefoxDriver(firefoxOptions);
umarch06
commented
Jun 30, 2018
•
|
@alkayata can you please suggest me solution for C#, here is what I am doing but browser doesn't do anything just open and then no action is performed.
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
whimboo
Jul 2, 2018
Collaborator
@umarch06 so Firefox doesn't have an argument marionette-port. You have to add it to the call of the FirefoxDriver constructor instead. But I don't know how the C# implementation handles that exactly.
|
@umarch06 so Firefox doesn't have an argument |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
umarch06
commented
Jul 2, 2018
|
Can you share sample for any other language? I'll highly appreciate it. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
whimboo
Jul 4, 2018
Collaborator
I cannot help here given that I didn't work with C# yet. And as such I don't know the driver at all. But you can check the API docs at https://seleniumhq.github.io/selenium/docs/api/dotnet/.
|
I cannot help here given that I didn't work with C# yet. And as such I don't know the driver at all. But you can check the API docs at https://seleniumhq.github.io/selenium/docs/api/dotnet/. |
tarheeldobe
referenced this issue
Jul 26, 2018
Closed
Geckodriver proxy:noProxy data type error #1855
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
pmaddi2
Jul 27, 2018
Even after following work around steps, still able to encounter marionette connection issue.
Geckodriver20 or 18
Firefox 52
Selenium 3.13 or 3.4
Java
With custom or default profile path arguments, always listening port is 2828 and not entering into next step "ie.:- driver.get(URL); and traces are showing these:---
"Marionette INFO Listening on port 2828"
"geckodriver::marionette TRACE connection attempt 6/600"
"geckodriver::marionette TRACE connection attempt 6/600"
If there is no profile argument provided, Marionette is taking some random available port, and Marionette connection is successful and able to execute further URL navigation step.
Code Used with or without Marionette and with Custom or default profile path arguments is:-
//ffoptions.addArguments("--marionette-port 2828");
ffoptions.setAcceptInsecureCerts(true);
ffoptions.setLogLevel(FirefoxDriverLogLevel.TRACE);
//ffoptions.addArguments("--binary C:\Program Files (x86)\Mozilla Firefox\firefox.exe");
ffoptions.addArguments("-profile");
//ffoptions.addArguments("C:\defaultprofilepath\Optum.default");
ffoptions.addArguments(customProfilePath);
driver = new FirefoxDriver(ffoptions);
driver.get(URL);
Also Tried with below code able to navigate further steps (i.e.:- App URL, etc..,), but unable to replace/append custom(temp) & default profile cookies with successful authenticated cookies.
ffoptions.setAcceptInsecureCerts(true);
ffoptions.setLogLevel(FirefoxDriverLogLevel.TRACE);
driver = new FirefoxDriver(ffoptions);
driver.get(url);
Could anyone please advise me solution for navigating geckodriver with custom profile. Please let me know if you need any further details in-order to provide solution
pmaddi2
commented
Jul 27, 2018
|
Even after following work around steps, still able to encounter marionette connection issue. Geckodriver20 or 18 With custom or default profile path arguments, always listening port is 2828 and not entering into next step "ie.:- driver.get(URL); and traces are showing these:--- If there is no profile argument provided, Marionette is taking some random available port, and Marionette connection is successful and able to execute further URL navigation step. Code Used with or without Marionette and with Custom or default profile path arguments is:- Also Tried with below code able to navigate further steps (i.e.:- App URL, etc..,), but unable to replace/append custom(temp) & default profile cookies with successful authenticated cookies. Could anyone please advise me solution for navigating geckodriver with custom profile. Please let me know if you need any further details in-order to provide solution |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
andreastt
Jul 27, 2018
Member
Firefox 52 is not supported by geckodriver. Can we please only add comments that are actually relevant to the issue.
|
Firefox 52 is not supported by geckodriver. Can we please only add comments that are actually relevant to the issue. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
pmaddi2
Jul 29, 2018
Actually I tried with version 62 nightly build, still able to reproduce issue, showing browser connection refused, not going to navigate url step...
Sorry correct FF version is 52.8.1 i tested was this.
Could you please advise which least version combinations works for my scenario? So that I’ll get that versions..
pmaddi2
commented
Jul 29, 2018
•
|
Actually I tried with version 62 nightly build, still able to reproduce issue, showing browser connection refused, not going to navigate url step... Could you please advise which least version combinations works for my scenario? So that I’ll get that versions.. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
whimboo
Jul 30, 2018
Collaborator
@pmaddi2 as it looks like the Java bindings of Selenium don't allow you to specify a port for Marionette. As least I cannot find anything in the Java API docs. So you will have to wait until this issue has been fixed.
|
@pmaddi2 as it looks like the Java bindings of Selenium don't allow you to specify a port for Marionette. As least I cannot find anything in the Java API docs. So you will have to wait until this issue has been fixed. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
pmaddi2
Jul 30, 2018
Thank you Henrik,
I'll wait for the fix.
In parallel if you get any alternate solution for profile loading. (like extension to override Marionette listening port before driver triggers it),etc. then could you please advise me/share in this thread. It is happening only with Custom profile Version 52.8.1 & 55.
And Geckodriver 21 or 20.1 with firefox 62/63 nightly build is starting by taking some random free port(not 2828), but showing connection refused 500 internal server error. I retried by restarting machine and & clearing cache. still no luck.
pmaddi2
commented
Jul 30, 2018
|
Thank you Henrik, I'll wait for the fix. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
pmaddi2
commented
Jul 31, 2018
|
Thank you @whimboo I’ll wait |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
mnemyx
Jul 31, 2018
@whimboo Thanks for the clarification in Python.
My scenario isn't exactly one-to-one; I'm using a remote Selenium Grid on a Windows Server with the profile on a local machine, not on the node itself. So if it helps anyone with a similar setup:
1.) I followed @soosrol's lead but the batch file ends up as:
C:\bin\geckodriver.exe %* --marionette-port 2828
2.) Node init on the grid:
java -Dwebdriver.gecko.driver=C:\bin\geckodriver.bat -jar C:\selenium\selenium-server-standalone-3.13.0.jar -role node -hub http://localhost:4444/grid/register
3.) And python:
opts = webdriver.FirefoxOptions()
prof = webdriver.FirefoxProfile("/path/to/local/profile")
opts.profile = prof
driver = webdriver.Remote(command_executor="http://remote.hub", options=opts)Thanks again for saving me several hours of frustration!
mnemyx
commented
Jul 31, 2018
•
|
@whimboo Thanks for the clarification in Python. My scenario isn't exactly one-to-one; I'm using a remote Selenium Grid on a Windows Server with the profile on a local machine, not on the node itself. So if it helps anyone with a similar setup: 1.) I followed @soosrol's lead but the batch file ends up as: 2.) Node init on the grid: 3.) And python: opts = webdriver.FirefoxOptions()
prof = webdriver.FirefoxProfile("/path/to/local/profile")
opts.profile = prof
driver = webdriver.Remote(command_executor="http://remote.hub", options=opts)Thanks again for saving me several hours of frustration! |
ajpetersons
referenced this issue
Aug 15, 2018
Open
Nightwatch doesnt work with firefox with profile #1543
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
artemklushin
Aug 22, 2018
@umarch06 For c# you can try next solution:
FirefoxDriverService ffDriverService = FirefoxDriverService.CreateDefaultService(<driver path>);
ffDriverService.BrowserCommunicationPort = 2828;
IWebDriver driver = new FirefoxDriver(ffDriverService, <instance of FirefoxOptions>);It's works for me with profile in custom directory.
artemklushin
commented
Aug 22, 2018
•
|
@umarch06 For c# you can try next solution: FirefoxDriverService ffDriverService = FirefoxDriverService.CreateDefaultService(<driver path>);
ffDriverService.BrowserCommunicationPort = 2828;
IWebDriver driver = new FirefoxDriver(ffDriverService, <instance of FirefoxOptions>);It's works for me with profile in custom directory. |
This comment was marked as off-topic.
Show comment
Hide comment
This comment was marked as off-topic.
xbxolivesupport
Sep 11, 2018
follow this code
package demo1;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.remote.DesiredCapabilities;
public class Executer2 {
public static void main(String[] args){
DesiredCapabilities capabilities = DesiredCapabilities.firefox();
capabilities.setCapability("acceptInsecureCerts", true);
capabilities.setJavascriptEnabled(true);
capabilities.setCapability("marionette", true);
WebDriver driver = new FirefoxDriver(capabilities);
System.setProperty("webdriver.gecko.driver", System.getProperty("user.dir") + "/geckodriver.exe");
driver.get("http://www.google.com");
driver.close();
}
any issue regarding browser get help from this
https://www.browsertechnicalsupportnumbers.com/blog/fix-mozilla-firefox-gmail-error-code-007/
xbxolivesupport
commented
Sep 11, 2018
|
follow this code import org.openqa.selenium.WebDriver; public class Executer2 { public static void main(String[] args){
} https://www.browsertechnicalsupportnumbers.com/blog/fix-mozilla-firefox-gmail-error-code-007/ |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
cloudinfra
Sep 12, 2018
The workaround is awesome. we renamed the original gekodriver-v0.21 to gekodriver_original, and the wapper script to gekodriver-v0.21. the script used gekodriver_original with the --marionette-port 2828. Also, the port 2828 is specified in the user.js file inside the profile you are passing. so if you find a different port number there, you have to accordingly use the correct one. (marionette.port)
This approach avoids specifying webdriver.gecko.driver. Just another approach if you dont want to change the launching of the hub jar.
cloudinfra
commented
Sep 12, 2018
•
|
The workaround is awesome. we renamed the original gekodriver-v0.21 to gekodriver_original, and the wapper script to gekodriver-v0.21. the script used gekodriver_original with the --marionette-port 2828. Also, the port 2828 is specified in the user.js file inside the profile you are passing. so if you find a different port number there, you have to accordingly use the correct one. (marionette.port) This approach avoids specifying webdriver.gecko.driver. Just another approach if you dont want to change the launching of the hub jar. |


soosrol commentedNov 15, 2017
System
Testcase
Expected result
Actual result
Notes
fo.addArguments("-profile", "./firefoxprofile");firefox.exe -profile "path/to/profile"also works.Stacktrace
Trace-level log