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

Invalid proxy settings #41

Closed
ghost opened this issue Oct 22, 2016 · 3 comments
Closed

Invalid proxy settings #41

ghost opened this issue Oct 22, 2016 · 3 comments
Assignees

Comments

@ghost
Copy link

ghost commented Oct 22, 2016

tebeka/selenium version 0.9.2
selenium-server version 3.0.1 and 2.53.1
firefox version 49.0.1

Code specified inside the proxy is invalid, firefox network options display "system settings.".
Tested python version, the agent can work properly.

I checked the information in the afternoon did not determine what the problem is, how should the agent should be installed?

package main

import (
    "fmt"

    "github.com/tebeka/selenium"
)

func main() {
    proxy := selenium.Proxy{
        Type:  "manual",
        SOCKS: "107.172.253.236:1080",
    }

    caps := selenium.Capabilities{
        "browserName": "firefox",
        "proxy":       proxy,
    }

    /*  The same invalid
        caps := selenium.Capabilities{
            "browserName": "firefox",
            "webdriver.gecko.driver": "",
            "proxy": map[string]interface{}{
                "proxyType":"manual",
                "httpProxy": "http://1.2.3.4:999",
                // etc.
            },
        }

    */

    wd, _ := selenium.NewRemote(caps, "")
    _ = wd

    fmt.Println("aaaaaaaa")

    //defer wd.Quit()

}

selenium-server log
Also tested 3.0.1, the same can not set the agent

D:\>java -jar selenium-server-standalone-2.53.1.jar
20:47:53.885 INFO - Launching a standalone Selenium Server
20:47:53.993 INFO - Java: Oracle Corporation 25.111-b14
20:47:53.993 INFO - OS: Windows 10 10.0 x86
20:47:54.004 INFO - v2.53.1, with Core v2.53.1. Built from revision a36b8b1
20:47:54.070 INFO - Driver class not found: com.opera.core.systems.OperaDriver
20:47:54.070 INFO - Driver provider com.opera.core.systems.OperaDriver is not registered
20:47:54.080 INFO - Driver provider org.openqa.selenium.safari.SafariDriver registration is skipped:
registration capabilities Capabilities [{browserName=safari, version=, platform=MAC}] does not match the current platform WIN10
20:47:54.081 INFO - Driver class not found: org.openqa.selenium.htmlunit.HtmlUnitDriver
20:47:54.082 INFO - Driver provider org.openqa.selenium.htmlunit.HtmlUnitDriver is not registered
20:47:54.243 INFO - RemoteWebDriver instances should connect to: http://127.0.0.1:4444/wd/hub
20:47:54.243 INFO - Selenium Server is up and running
20:48:00.525 INFO - Executing: [new session: Capabilities [{proxy={proxyType=manual, socksProxy=107.172.253.236:1080}, browserName=firefox}]])
20:48:00.551 INFO - Creating a new session for Capabilities [{proxy={proxyType=manual, socksProxy=107.172.253.236:1080}, browserName=firefox}]
org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
ID":"ZeuCFoW-X82Y","location":"app-global","version":"49.0.1","type":"theme","internalName":"classic/1.0","updateURL":null,"updateKey":null,"optionsURL":null,"optionsType":null,"aboutURL":null,"icons":{"32":"icon.png","48":"icon.png"},"iconURL":null,"icon64URL":null,"defaultLocale":{"name":"Default","description":"The default theme.","creator":"Mozilla","homepageURL":null,"contributors":["Mozilla Contributors"]},"visible":true,"active":true,"userDisabled":false,"appDisabled":false,"descriptor":"C:\\Program Files (x86)\\Mozilla Firefox\\browser\\extensions\\{972ce4c6-7e08-4474-a285-3208198ce6fd}.xpi","installDate":1474592003179,"updateDate":1474592003179,"applyBackgroundUpdates":1,"skinnable":true,"size":21905,"sourceURI":null,"releaseNotesURI":null,"softDisabled":false,"foreignInstall":false,"hasBinaryComponents":false,"strictCompatibility":true,"locales":[],"targetApplications":[{"id":"{ec8030f7-c20a-464f-9b0e-13a3a9e97384}","minVersion":"49.0.1","maxVersion":"49.0.1"}],"targetPlatforms":[],"seen":true}
1477140481755   addons.xpi      DEBUG   getModTime: Recursive scan of {972ce4c6-7e08-4474-a285-3208198ce6fd}
1477140481756   DeferredSave.extensions.json    DEBUG   Save changes
1477140481757   addons.xpi      DEBUG   Updating database with changes to installed add-ons
1477140481757   addons.xpi-utils        DEBUG   Updating add-on states
1477140481758   addons.xpi-utils        DEBUG   Writing add-ons list
1477140481763   addons.xpi      DEBUG   Registering manifest for C:\Program Files (x86)\Mozilla Firefox\browser\features\e10srollout@mozilla.org.xpi
1477140481764   addons.xpi      DEBUG   Calling bootstrap method startup on e10srollout@mozilla.org version 1.2
1477140481764   addons.xpi      DEBUG   Registering manifest for C:\Program Files (x86)\Mozilla Firefox\browser\features\firefox@getpocket.com.xpi
1477140481765   addons.xpi      DEBUG   Calling bootstrap method startup on firefox@getpocket.com version 1.0.4
1477140481766   addons.xpi      DEBUG   Registering manifest for C:\Program Files (x86)\Mozilla Firefox\browser\features\webcompat@mozilla.org.xpi
1477140481766   addons.xpi      DEBUG   Calling bootstrap method startup on webcompat@mozilla.org version 1.0
1477140481768   addons.manager  DEBUG   Registering shutdown blocker for XPIProvider
1477140481768   addons.manager  DEBUG   Provider finished startup: XPIProvider
1477140481768   addons.manager  DEBUG   Starting provider: LightweightThemeManager
1477140481768   addons.manager  DEBUG   Registering shutdown blocker for LightweightThemeManager
1477140481768   addons.manager  DEBUG   Provider finished startup: LightweightThemeManager
1477140481769   addons.manager  DEBUG   Starting provider: GMPProvider
1477140481778   addons.manager  DEBUG   Registering shutdown blocker for GMPProvider
1477140481778   addons.manager  DEBUG   Provider finished startup: GMPProvider
1477140481778   addons.manager  DEBUG   Starting provider: PluginProvider
1477140481779   addons.manager  DEBUG   Registering shutdown blocker for PluginProvider
1477140481779   addons.manager  DEBUG   Provider finished startup: PluginProvider
1477140481779   addons.manager  DEBUG   Completed startup sequence
1477140482233   addons.manager  DEBUG   Starting provider: <unnamed-provider>
1477140482233   addons.manager  DEBUG   Registering shutdown blocker for <unnamed-provider>
1477140482234   addons.manager  DEBUG   Provider finished startup: <unnamed-provider>
1477140482237   DeferredSave.extensions.json    DEBUG   Starting write
1477140482495   addons.repository       DEBUG   No addons.json found.
1477140482496   DeferredSave.addons.json        DEBUG   Save changes
1477140482500   DeferredSave.addons.json        DEBUG   Starting timer
1477140482572   addons.manager  DEBUG   Starting provider: PreviousExperimentProvider
1477140482573   addons.manager  DEBUG   Registering shutdown blocker for PreviousExperimentProvider
1477140482573   addons.manager  DEBUG   Provider finished startup: PreviousExperimentProvider
1477140482577   DeferredSave.extensions.json    DEBUG   Write succeeded
1477140482578   addons.xpi-utils        DEBUG   XPI Database saved, setting schema version preference to 17
1477140482580   DeferredSave.addons.json        DEBUG   Starting write
1477140482608   DeferredSave.addons.json        DEBUG   Write succeeded

        at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:112)
        at org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:271)
        at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:119)
        at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:218)
        at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:211)
        at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:129)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
        at java.lang.reflect.Constructor.newInstance(Unknown Source)
        at org.openqa.selenium.remote.server.FirefoxDriverProvider.callConstructor(FirefoxDriverProvider.java:91)
        at org.openqa.selenium.remote.server.FirefoxDriverProvider.newInstance(FirefoxDriverProvider.java:68)
        at org.openqa.selenium.remote.server.DefaultDriverFactory.newInstance(DefaultDriverFactory.java:60)
        at org.openqa.selenium.remote.server.DefaultSession$BrowserCreator.call(DefaultSession.java:222)
        at org.openqa.selenium.remote.server.DefaultSession$BrowserCreator.call(DefaultSession.java:1)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at org.openqa.selenium.remote.server.DefaultSession$1.run(DefaultSession.java:176)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
20:48:47.089 WARN - Exception thrown
java.util.concurrent.ExecutionException: org.openqa.selenium.WebDriverException: java.lang.reflect.InvocationTargetException
Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:37:03'
System info: host: 'DESKTOP-OQVJ62N', ip: '169.254.159.21', os.name: 'Windows 10', os.arch: 'x86', os.version: '10.0', java.version: '1.8.0_111'
Driver info: driver.version: unknown
        at java.util.concurrent.FutureTask.report(Unknown Source)
        at java.util.concurrent.FutureTask.get(Unknown Source)
        at org.openqa.selenium.remote.server.DefaultSession.execute(DefaultSession.java:183)
        at org.openqa.selenium.remote.server.DefaultSession.<init>(DefaultSession.java:119)
        at org.openqa.selenium.remote.server.DefaultSession.createSession(DefaultSession.java:95)
        at org.openqa.selenium.remote.server.DefaultDriverSessions.newSession(DefaultDriverSessions.java:124)
        at org.openqa.selenium.remote.server.handler.NewSession.handle(NewSession.java:59)
        at org.openqa.selenium.remote.server.handler.NewSession.handle(NewSession.java:1)
        at org.openqa.selenium.remote.server.rest.ResultConfig.handle(ResultConfig.java:111)
        at org.openqa.selenium.remote.server.JsonHttpCommandHandler.handleRequest(JsonHttpCommandHandler.java:79)
        at org.openqa.selenium.remote.server.DriverServlet.handleRequest(DriverServlet.java:204)
        at org.openqa.selenium.remote.server.DriverServlet.doPost(DriverServlet.java:166)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
        at org.openqa.selenium.remote.server.DriverServlet.service(DriverServlet.java:132)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
        at org.openqa.jetty.jetty.servlet.ServletHolder.handle(ServletHolder.java:428)
        at org.openqa.jetty.jetty.servlet.ServletHandler.dispatch(ServletHandler.java:680)
        at org.openqa.jetty.jetty.servlet.ServletHandler.handle(ServletHandler.java:571)
        at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:1526)
        at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:1479)
        at org.openqa.jetty.http.HttpServer.service(HttpServer.java:920)
        at org.openqa.jetty.http.HttpConnection.service(HttpConnection.java:820)
        at org.openqa.jetty.http.HttpConnection.handleNext(HttpConnection.java:986)
        at org.openqa.jetty.http.HttpConnection.handle(HttpConnection.java:837)
        at org.openqa.jetty.http.SocketListener.handleConnection(SocketListener.java:243)
        at org.openqa.jetty.util.ThreadedServer.handle(ThreadedServer.java:358)
        at org.openqa.jetty.util.ThreadPool$PoolThread.run(ThreadPool.java:537)
Caused by: org.openqa.selenium.WebDriverException: java.lang.reflect.InvocationTargetException
Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:37:03'
System info: host: 'DESKTOP-OQVJ62N', ip: '169.254.159.21', os.name: 'Windows 10', os.arch: 'x86', os.version: '10.0', java.version: '1.8.0_111'
Driver info: driver.version: unknown
        at org.openqa.selenium.remote.server.FirefoxDriverProvider.callConstructor(FirefoxDriverProvider.java:101)
        at org.openqa.selenium.remote.server.FirefoxDriverProvider.newInstance(FirefoxDriverProvider.java:68)
        at org.openqa.selenium.remote.server.DefaultDriverFactory.newInstance(DefaultDriverFactory.java:60)
        at org.openqa.selenium.remote.server.DefaultSession$BrowserCreator.call(DefaultSession.java:222)
        at org.openqa.selenium.remote.server.DefaultSession$BrowserCreator.call(DefaultSession.java:1)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at org.openqa.selenium.remote.server.DefaultSession$1.run(DefaultSession.java:176)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
        at java.lang.reflect.Constructor.newInstance(Unknown Source)
        at org.openqa.selenium.remote.server.FirefoxDriverProvider.callConstructor(FirefoxDriverProvider.java:91)
        ... 9 more
Caused by: org.openqa.selenium.WebDriverException: Failed to connect to binary FirefoxBinary(C:\Program Files (x86)\Mozilla Firefox\firefox.exe) on port 7055; process output follows:
ID":"ZeuCFoW-X82Y","location":"app-global","version":"49.0.1","type":"theme","internalName":"classic/1.0","updateURL":null,"updateKey":null,"optionsURL":null,"optionsType":null,"aboutURL":null,"icons":{"32":"icon.png","48":"icon.png"},"iconURL":null,"icon64URL":null,"defaultLocale":{"name":"Default","description":"The default theme.","creator":"Mozilla","homepageURL":null,"contributors":["Mozilla Contributors"]},"visible":true,"active":true,"userDisabled":false,"appDisabled":false,"descriptor":"C:\\Program Files (x86)\\Mozilla Firefox\\browser\\extensions\\{972ce4c6-7e08-4474-a285-3208198ce6fd}.xpi","installDate":1474592003179,"updateDate":1474592003179,"applyBackgroundUpdates":1,"skinnable":true,"size":21905,"sourceURI":null,"releaseNotesURI":null,"softDisabled":false,"foreignInstall":false,"hasBinaryComponents":false,"strictCompatibility":true,"locales":[],"targetApplications":[{"id":"{ec8030f7-c20a-464f-9b0e-13a3a9e97384}","minVersion":"49.0.1","maxVersion":"49.0.1"}],"targetPlatforms":[],"seen":true}
1477140481755   addons.xpi      DEBUG   getModTime: Recursive scan of {972ce4c6-7e08-4474-a285-3208198ce6fd}
1477140481756   DeferredSave.extensions.json    DEBUG   Save changes
1477140481757   addons.xpi      DEBUG   Updating database with changes to installed add-ons
1477140481757   addons.xpi-utils        DEBUG   Updating add-on states
1477140481758   addons.xpi-utils        DEBUG   Writing add-ons list
1477140481763   addons.xpi      DEBUG   Registering manifest for C:\Program Files (x86)\Mozilla Firefox\browser\features\e10srollout@mozilla.org.xpi
1477140481764   addons.xpi      DEBUG   Calling bootstrap method startup on e10srollout@mozilla.org version 1.2
1477140481764   addons.xpi      DEBUG   Registering manifest for C:\Program Files (x86)\Mozilla Firefox\browser\features\firefox@getpocket.com.xpi
1477140481765   addons.xpi      DEBUG   Calling bootstrap method startup on firefox@getpocket.com version 1.0.4
1477140481766   addons.xpi      DEBUG   Registering manifest for C:\Program Files (x86)\Mozilla Firefox\browser\features\webcompat@mozilla.org.xpi
1477140481766   addons.xpi      DEBUG   Calling bootstrap method startup on webcompat@mozilla.org version 1.0
1477140481768   addons.manager  DEBUG   Registering shutdown blocker for XPIProvider
1477140481768   addons.manager  DEBUG   Provider finished startup: XPIProvider
1477140481768   addons.manager  DEBUG   Starting provider: LightweightThemeManager
1477140481768   addons.manager  DEBUG   Registering shutdown blocker for LightweightThemeManager
1477140481768   addons.manager  DEBUG   Provider finished startup: LightweightThemeManager
1477140481769   addons.manager  DEBUG   Starting provider: GMPProvider
1477140481778   addons.manager  DEBUG   Registering shutdown blocker for GMPProvider
1477140481778   addons.manager  DEBUG   Provider finished startup: GMPProvider
1477140481778   addons.manager  DEBUG   Starting provider: PluginProvider
1477140481779   addons.manager  DEBUG   Registering shutdown blocker for PluginProvider
1477140481779   addons.manager  DEBUG   Provider finished startup: PluginProvider
1477140481779   addons.manager  DEBUG   Completed startup sequence
1477140482233   addons.manager  DEBUG   Starting provider: <unnamed-provider>
1477140482233   addons.manager  DEBUG   Registering shutdown blocker for <unnamed-provider>
1477140482234   addons.manager  DEBUG   Provider finished startup: <unnamed-provider>
1477140482237   DeferredSave.extensions.json    DEBUG   Starting write
1477140482495   addons.repository       DEBUG   No addons.json found.
1477140482496   DeferredSave.addons.json        DEBUG   Save changes
1477140482500   DeferredSave.addons.json        DEBUG   Starting timer
1477140482572   addons.manager  DEBUG   Starting provider: PreviousExperimentProvider
1477140482573   addons.manager  DEBUG   Registering shutdown blocker for PreviousExperimentProvider
1477140482573   addons.manager  DEBUG   Provider finished startup: PreviousExperimentProvider
1477140482577   DeferredSave.extensions.json    DEBUG   Write succeeded
1477140482578   addons.xpi-utils        DEBUG   XPI Database saved, setting schema version preference to 17
1477140482580   DeferredSave.addons.json        DEBUG   Starting write
1477140482608   DeferredSave.addons.json        DEBUG   Write succeeded

Build info: version: '2.53.1', revision: 'a36b8b1', time: '2016-06-30 17:37:03'
System info: host: 'DESKTOP-OQVJ62N', ip: '169.254.159.21', os.name: 'Windows 10', os.arch: 'x86', os.version: '10.0', java.version: '1.8.0_111'
Driver info: driver.version: FirefoxDriver
        at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:124)
        at org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:271)
        at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:119)
        at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:218)
        at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:211)
        at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:129)
        ... 14 more
Caused by: org.openqa.selenium.firefox.NotConnectedException: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
ID":"ZeuCFoW-X82Y","location":"app-global","version":"49.0.1","type":"theme","internalName":"classic/1.0","updateURL":null,"updateKey":null,"optionsURL":null,"optionsType":null,"aboutURL":null,"icons":{"32":"icon.png","48":"icon.png"},"iconURL":null,"icon64URL":null,"defaultLocale":{"name":"Default","description":"The default theme.","creator":"Mozilla","homepageURL":null,"contributors":["Mozilla Contributors"]},"visible":true,"active":true,"userDisabled":false,"appDisabled":false,"descriptor":"C:\\Program Files (x86)\\Mozilla Firefox\\browser\\extensions\\{972ce4c6-7e08-4474-a285-3208198ce6fd}.xpi","installDate":1474592003179,"updateDate":1474592003179,"applyBackgroundUpdates":1,"skinnable":true,"size":21905,"sourceURI":null,"releaseNotesURI":null,"softDisabled":false,"foreignInstall":false,"hasBinaryComponents":false,"strictCompatibility":true,"locales":[],"targetApplications":[{"id":"{ec8030f7-c20a-464f-9b0e-13a3a9e97384}","minVersion":"49.0.1","maxVersion":"49.0.1"}],"targetPlatforms":[],"seen":true}
1477140481755   addons.xpi      DEBUG   getModTime: Recursive scan of {972ce4c6-7e08-4474-a285-3208198ce6fd}
1477140481756   DeferredSave.extensions.json    DEBUG   Save changes
1477140481757   addons.xpi      DEBUG   Updating database with changes to installed add-ons
1477140481757   addons.xpi-utils        DEBUG   Updating add-on states
1477140481758   addons.xpi-utils        DEBUG   Writing add-ons list
1477140481763   addons.xpi      DEBUG   Registering manifest for C:\Program Files (x86)\Mozilla Firefox\browser\features\e10srollout@mozilla.org.xpi
1477140481764   addons.xpi      DEBUG   Calling bootstrap method startup on e10srollout@mozilla.org version 1.2
1477140481764   addons.xpi      DEBUG   Registering manifest for C:\Program Files (x86)\Mozilla Firefox\browser\features\firefox@getpocket.com.xpi
1477140481765   addons.xpi      DEBUG   Calling bootstrap method startup on firefox@getpocket.com version 1.0.4
1477140481766   addons.xpi      DEBUG   Registering manifest for C:\Program Files (x86)\Mozilla Firefox\browser\features\webcompat@mozilla.org.xpi
1477140481766   addons.xpi      DEBUG   Calling bootstrap method startup on webcompat@mozilla.org version 1.0
1477140481768   addons.manager  DEBUG   Registering shutdown blocker for XPIProvider
1477140481768   addons.manager  DEBUG   Provider finished startup: XPIProvider
1477140481768   addons.manager  DEBUG   Starting provider: LightweightThemeManager
1477140481768   addons.manager  DEBUG   Registering shutdown blocker for LightweightThemeManager
1477140481768   addons.manager  DEBUG   Provider finished startup: LightweightThemeManager
1477140481769   addons.manager  DEBUG   Starting provider: GMPProvider
1477140481778   addons.manager  DEBUG   Registering shutdown blocker for GMPProvider
1477140481778   addons.manager  DEBUG   Provider finished startup: GMPProvider
1477140481778   addons.manager  DEBUG   Starting provider: PluginProvider
1477140481779   addons.manager  DEBUG   Registering shutdown blocker for PluginProvider
1477140481779   addons.manager  DEBUG   Provider finished startup: PluginProvider
1477140481779   addons.manager  DEBUG   Completed startup sequence
1477140482233   addons.manager  DEBUG   Starting provider: <unnamed-provider>
1477140482233   addons.manager  DEBUG   Registering shutdown blocker for <unnamed-provider>
1477140482234   addons.manager  DEBUG   Provider finished startup: <unnamed-provider>
1477140482237   DeferredSave.extensions.json    DEBUG   Starting write
1477140482495   addons.repository       DEBUG   No addons.json found.
1477140482496   DeferredSave.addons.json        DEBUG   Save changes
1477140482500   DeferredSave.addons.json        DEBUG   Starting timer
1477140482572   addons.manager  DEBUG   Starting provider: PreviousExperimentProvider
1477140482573   addons.manager  DEBUG   Registering shutdown blocker for PreviousExperimentProvider
1477140482573   addons.manager  DEBUG   Provider finished startup: PreviousExperimentProvider
1477140482577   DeferredSave.extensions.json    DEBUG   Write succeeded
1477140482578   addons.xpi-utils        DEBUG   XPI Database saved, setting schema version preference to 17
1477140482580   DeferredSave.addons.json        DEBUG   Starting write
1477140482608   DeferredSave.addons.json        DEBUG   Write succeeded

        at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:112)
        ... 19 more
20:48:47.100 WARN - Exception: Unable to connect to host 127.0.0.1 on port 7055 after 45000 ms. Firefox console output:
ID":"ZeuCFoW-X82Y","location":"app-global","version":"49.0.1","type":"theme","internalName":"classic/1.0","updateURL":null,"updateKey":null,"optionsURL":null,"optionsType":null,"aboutURL":null,"icons":{"32":"icon.png","48":"icon.png"},"iconURL":null,"icon64URL":null,"defaultLocale":{"name":"Default","description":"The default theme.","creator":"Mozilla","homepageURL":null,"contributors":["Mozilla Contributors"]},"visible":true,"active":true,"userDisabled":false,"appDisabled":false,"descriptor":"C:\\Program Files (x86)\\Mozilla Firefox\\browser\\extensions\\{972ce4c6-7e08-4474-a285-3208198ce6fd}.xpi","installDate":1474592003179,"updateDate":1474592003179,"applyBackgroundUpdates":1,"skinnable":true,"size":21905,"sourceURI":null,"releaseNotesURI":null,"softDisabled":false,"foreignInstall":false,"hasBinaryComponents":false,"strictCompatibility":true,"locales":[],"targetApplications":[{"id":"{ec8030f7-c20a-464f-9b0e-13a3a9e97384}","minVersion":"49.0.1","maxVersion":"49.0.1"}],"targetPlatforms":[],"seen":true}
1477140481755   addons.xpi      DEBUG   getModTime: Recursive scan of {972ce4c6-7e08-4474-a285-3208198ce6fd}
1477140481756   DeferredSave.extensions.json    DEBUG   Save changes
1477140481757   addons.xpi      DEBUG   Updating database with changes to installed add-ons
1477140481757   addons.xpi-utils        DEBUG   Updating add-on states
1477140481758   addons.xpi-utils        DEBUG   Writing add-ons list
1477140481763   addons.xpi      DEBUG   Registering manifest for C:\Program Files (x86)\Mozilla Firefox\browser\features\e10srollout@mozilla.org.xpi
1477140481764   addons.xpi      DEBUG   Calling bootstrap method startup on e10srollout@mozilla.org version 1.2
1477140481764   addons.xpi      DEBUG   Registering manifest for C:\Program Files (x86)\Mozilla Firefox\browser\features\firefox@getpocket.com.xpi
1477140481765   addons.xpi      DEBUG   Calling bootstrap method startup on firefox@getpocket.com version 1.0.4
1477140481766   addons.xpi      DEBUG   Registering manifest for C:\Program Files (x86)\Mozilla Firefox\browser\features\webcompat@mozilla.org.xpi
1477140481766   addons.xpi      DEBUG   Calling bootstrap method startup on webcompat@mozilla.org version 1.0
1477140481768   addons.manager  DEBUG   Registering shutdown blocker for XPIProvider
1477140481768   addons.manager  DEBUG   Provider finished startup: XPIProvider
1477140481768   addons.manager  DEBUG   Starting provider: LightweightThemeManager
1477140481768   addons.manager  DEBUG   Registering shutdown blocker for LightweightThemeManager
1477140481768   addons.manager  DEBUG   Provider finished startup: LightweightThemeManager
1477140481769   addons.manager  DEBUG   Starting provider: GMPProvider
1477140481778   addons.manager  DEBUG   Registering shutdown blocker for GMPProvider
1477140481778   addons.manager  DEBUG   Provider finished startup: GMPProvider
1477140481778   addons.manager  DEBUG   Starting provider: PluginProvider
1477140481779   addons.manager  DEBUG   Registering shutdown blocker for PluginProvider
1477140481779   addons.manager  DEBUG   Provider finished startup: PluginProvider
1477140481779   addons.manager  DEBUG   Completed startup sequence
1477140482233   addons.manager  DEBUG   Starting provider: <unnamed-provider>
1477140482233   addons.manager  DEBUG   Registering shutdown blocker for <unnamed-provider>
1477140482234   addons.manager  DEBUG   Provider finished startup: <unnamed-provider>
1477140482237   DeferredSave.extensions.json    DEBUG   Starting write
1477140482495   addons.repository       DEBUG   No addons.json found.
1477140482496   DeferredSave.addons.json        DEBUG   Save changes
1477140482500   DeferredSave.addons.json        DEBUG   Starting timer
1477140482572   addons.manager  DEBUG   Starting provider: PreviousExperimentProvider
1477140482573   addons.manager  DEBUG   Registering shutdown blocker for PreviousExperimentProvider
1477140482573   addons.manager  DEBUG   Provider finished startup: PreviousExperimentProvider
1477140482577   DeferredSave.extensions.json    DEBUG   Write succeeded
1477140482578   addons.xpi-utils        DEBUG   XPI Database saved, setting schema version preference to 17
1477140482580   DeferredSave.addons.json        DEBUG   Starting write
1477140482608   DeferredSave.addons.json        DEBUG   Write succeeded

20:51:49.214 INFO - Shutting down...
@tebeka
Copy link
Owner

tebeka commented Oct 23, 2016

Thanks for reporting! I'll try to take a look soon-ish.

@minusnine
Copy link
Collaborator

I'm looking into this. I created a test case in this branch:

https://github.com/tebeka/selenium/blob/topic/add-proxy-test/remote_test.go#L1190

Setting the proxy in the expected way works for Chrome and ChromeDriver. It does not work for Firefox 47 in Selenium2, the latest Firefox Nightly in Selenium3, or the latest Firefox Nightly directly through Geckodriver.

I posted these details on this Geckodriver issue: mozilla/geckodriver#470

It has been suggested to not use the Proxy settings for Selenium2, but use the Preferences settings. I can't seem to get that to work either

@minusnine minusnine reopened this Feb 15, 2017
@minusnine
Copy link
Collaborator

I have successfully used an HTTP proxy via both Firefox 47 and Selenium 2.x and Firefox Nightly through Geckodriver (in addition to Chrome and Chromedriver). Using Selenium 3 doesn't work, due to an error from Selenium 3:

remote_test.go:1427: wd.NewSession() returned error: unknown error - 33: Expected [object String]
 "{\"proxyAutoconfigUrl\":null,\"autodetect\":false,\"socksUsername\":null,\"socksPassword\":null,\"httpP
roxy\":null,\"proxyType\":\"MANUAL\",\"noProxy\":null,\"ftpProxy\":null,\"socksProxy\":null,\"hCode\":160
4894745,\"class\":\"org.openqa.selenium.Proxy\",\"sslProxy\":null}" to be an object (WARNING: The server 
did not provide any stacktrace information)

For recent versions of Firefox (48+), both Proxy.HTTP and Proxy.HTTPPort (or SSLPort or SocksPort) need to be set, the former with just the host name and the latter with just the port number.

See https://github.com/tebeka/selenium/blob/topic/add-proxy-test/remote_test.go#L1385 as an example.

I'll commit that soon once I debug the Selenium 3 bug more.

minusnine added a commit that referenced this issue Feb 27, 2017
The current state of using a Proxy is both well-defined and variously
implemented.

* Chrome and ChromeDriver uses just the HTTP field with a host:port.

* Firefox via GeckoDriver directly requires that the host be provided in
  the HTTP field and the port be provided in the HTTPPort field.

* Firefox via Selenium 2 uses just the HTTP field, with the caveat that
  connections to localhost are not proxied, by default. An additional
  preference is needed to unset this.

* Firefox via Selenium 3 and GeckoDriver fails because Selenium adds a
  whole bunch of "nulls" for unset values in the Proxy object, which
  Marionette does not like. mozilla/geckodriver#490

Fixes #41.
minusnine added a commit that referenced this issue Feb 27, 2017
The current state of using a Proxy is both well-defined and variously
implemented.

* Chrome and ChromeDriver uses just the HTTP field with a host:port.

* Firefox via GeckoDriver directly requires that the host be provided in
  the HTTP field and the port be provided in the HTTPPort field.

* Firefox via Selenium 2 uses just the HTTP field, with the caveat that
  connections to localhost are not proxied, by default. An additional
  preference is needed to unset this.

* Firefox via Selenium 3 and GeckoDriver fails because Selenium adds a
  whole bunch of "nulls" for unset values in the Proxy object, which
  Marionette does not like. mozilla/geckodriver#490

Fixes #41.
minusnine added a commit that referenced this issue Mar 12, 2017
The current state of using a Proxy is both well-defined and variously
implemented.

* Chrome and ChromeDriver uses just the HTTP field with a host:port.

* Firefox via GeckoDriver directly requires that the host be provided in
  the HTTP field and the port be provided in the HTTPPort field.

* Firefox via Selenium 2 uses just the HTTP field, with the caveat that
  connections to localhost are not proxied, by default. An additional
  preference is needed to unset this.

* Firefox via Selenium 3 and GeckoDriver fails because Selenium adds a
  whole bunch of "nulls" for unset values in the Proxy object, which
  Marionette does not like. mozilla/geckodriver#490

Fixes #41.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants