Skip to content
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

Marionette doesn't accept a hostport as a proxy address #764

Closed
juangj opened this issue Jun 2, 2017 · 8 comments
Closed

Marionette doesn't accept a hostport as a proxy address #764

juangj opened this issue Jun 2, 2017 · 8 comments

Comments

@juangj
Copy link
Contributor

juangj commented Jun 2, 2017

In order to help us efficiently investigate your issue, please provide the following information:

Firefox Version

55.0a1 (2017-06-01)

This has actually been happening for as long as I can remember having used Marionette/Geckodriver. We had put in a workaround for it, and I thought we'd filed a bug about it but I can't find it, so we probably forgot.

Platform

OSX at the moment, but it probably happens on all of them

Steps to reproduce -

Request a new session with these capabilities:

{
  "capabilities": {
    "alwaysMatch": {
      "proxy": {
        "proxyType": "manual",
        "httpProxy": "localhost:8888"
      }
    }
  }
}

The response is:

{
  "error":"session not created",
  "message":"InvalidArgumentError: Expected [object Undefined] undefined to be an integer",
  "stacktrace":"..."
}

Here's the trace log: geckodriver.log.txt

If you split the hostport into two fields, then the session creation succeeds:

"proxy": {
  "proxyType": "manual",
  "httpProxy": "localhost",
  "httpProxyPort": 8888
}

The error message appears to come from Marionette, but it seems like it may be easier to fix this by having Geckodriver just split the hostport. (And then it would work for all versions of Firefox, not just newer versions.)

@whimboo
Copy link
Collaborator

whimboo commented Jun 2, 2017

Right, the Webdriver spec also says: A domain, and optional port preceeded by a colon.

Given that geckodriver is our proxy between the spec and the custom socket protocol supported by Marionette, it's the former which needs the fix.

@whimboo
Copy link
Collaborator

whimboo commented Jun 2, 2017

@juangj, I filed https://bugzilla.mozilla.org/show_bug.cgi?id=1369827 to get your request implemented. Thanks for bringing it up.

@juangj
Copy link
Contributor Author

juangj commented Jun 2, 2017

Thanks! Do you prefer new bugs to be filed on Bugzilla at this point? I remember there was some plan to get Geckodriver imported in mozilla-central, but I'm not sure whether the intent was to move development over there too -- or maybe that has already happened.

@whimboo
Copy link
Collaborator

whimboo commented Jun 2, 2017

mozilla-central is the canonical repository now. We won't merge code into the github repo. Instead @andreastt will mark the master branch soon for clarity.

Regarding your question... if you will file clear and detailed bugs like this one please go ahead. Otherwise we prefer new issues here, which mostly might need further investigation on our side before a real bug gets filed.

@andreastt
Copy link
Contributor

andreastt commented Jun 3, 2017 via email

@whimboo
Copy link
Collaborator

whimboo commented Jun 9, 2017

Please also see the discussion on w3c/webdriver#949

@whimboo
Copy link
Collaborator

whimboo commented Sep 1, 2017

I filed https://bugzilla.mozilla.org/show_bug.cgi?id=1369827 to get your request implemented.

The feature is now available in Firefox Nightly. To use it with geckodriver you will need a nightly build or wait for the next release.

@gjundat95
Copy link

Work in Selenium 3.14.2, Firefox 62, C# .NET 4.5

 FirefoxOptions firefoxOptions = new FirefoxOptions();
            firefoxOptions.SetPreference("network.proxy.type", 1);
            firefoxOptions.SetPreference("network.proxy.socks", "127.0.0.1");
            firefoxOptions.SetPreference("network.proxy.socks_port", 1080);

            IWebDriver driver = new FirefoxDriver(service, firefoxOptions);

@mozilla mozilla locked as resolved and limited conversation to collaborators Sep 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants