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

[🐛 Bug]: why the docker image selenium/standalone-firefox supports proxy,but chrome doesn't? #14434

Closed
Ninjaxsh opened this issue Aug 24, 2024 · 4 comments
Labels
G-geckodriver Requires fixes in GeckoDriver I-defect

Comments

@Ninjaxsh
Copy link

What happened?

Whenever I initial proxy in docker-compose environment or test in Java, The proxy does take effect in selenium/standalone-chrome,but it's availability in selenium/standalone-firefox.

How can we reproduce the issue?

In docker-compose's yml environment

    environment:
      - http_proxy=nx.testdomain.com:24000 # brightdata's proxy manager service

In java


    /**
     * @param browser   "edge|chrome|firefox"
     * @param webDriver "http://a.test.cn:50019/wd/hub";
     * @param targetUrl "htts://www.google.com"
     * @param proxy     "nx.testdomain.com:24000"
     * @param targetTag "app"
     * @return
     * @throws MalformedURLException
     */
    public static RemoteWebDriver remoteWebDriver(String browser, String webDriver, String targetUrl, String proxy, String targetTag) throws MalformedURLException {

        ChromeOptions chromeOptions = new ChromeOptions();
        FirefoxOptions firefoxOptions = new FirefoxOptions();
        EdgeOptions edgeOptions = new EdgeOptions();
        // 设置代理
        Proxy reqProxy = new Proxy();
        if (!proxy.equals("")) {
            reqProxy.setHttpProxy(proxy);
            chromeOptions.setProxy(reqProxy);
            firefoxOptions.setProxy(reqProxy);
            edgeOptions.setProxy(reqProxy);
        }
        URL url = new URL(webDriver);
        DesiredCapabilities desiredCapabilities = new DesiredCapabilities();
        if (browser.equals("chrome")) {
            desiredCapabilities.merge(chromeOptions);
        } else if (browser.equals("firefox")) {
            desiredCapabilities.merge(firefoxOptions);
        } else {
            desiredCapabilities.merge(edgeOptions);
        }
        desiredCapabilities.setCapability("acceptInsecureCerts", true);

        RemoteWebDriver remoteWebDriver = new RemoteWebDriver(url, desiredCapabilities);
        remoteWebDriver.get(targetUrl);
        WebDriverWait webDriverWait = new WebDriverWait(remoteWebDriver, Duration.ofSeconds(15));
        webDriverWait.until(d -> remoteWebDriver.findElement(By.id(targetTag)).isDisplayed());
        return remoteWebDriver;
    }

Relevant log output

###### 1、these are standalone-chrome's log

12:07:48.650 INFO [LocalDistributor.newSession] - Session request received by the Distributor: 
 [Capabilities {acceptInsecureCerts: true, browserName: chrome, goog:chromeOptions: {args: [], extensions: []}, proxy: {httpProxy: nx.testdomain.com:24000, proxyType: manual}}]
12:07:49.088 INFO [LocalNode.newSession] - Session created by the Node. Id: ee2846da01d726c62672a9ad5f06ded5, Caps: Capabilities {acceptInsecureCerts: true, browserName: chrome, browserVersion: 127.0.6533.119, chrome: {chromedriverVersion: 127.0.6533.119 (bdef6783a05..., userDataDir: /tmp/.org.chromium.Chromium...}, fedcm:accounts: true, goog:chromeOptions: {debuggerAddress: localhost:44789}, networkConnectionEnabled: false, pageLoadStrategy: normal, platformName: linux, proxy: Proxy(manual, http=nx.testdomain..., se:bidiEnabled: false, se:cdp: ws://172.18.0.24:4444/sessi..., se:cdpVersion: 127.0.6533.119, se:vnc: ws://172.18.0.24:4444/sessi..., se:vncEnabled: true, se:vncLocalAddress: ws://172.18.0.24:7900, setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify, webauthn:extension:credBlob: true, webauthn:extension:largeBlob: true, webauthn:extension:minPinLength: true, webauthn:extension:prf: true, webauthn:virtualAuthenticators: true}
12:07:49.089 INFO [LocalDistributor.newSession] - Session created by the Distributor. Id: ee2846da01d726c62672a9ad5f06ded5 
 Caps: Capabilities {acceptInsecureCerts: true, browserName: chrome, browserVersion: 127.0.6533.119, chrome: {chromedriverVersion: 127.0.6533.119 (bdef6783a05..., userDataDir: /tmp/.org.chromium.Chromium...}, fedcm:accounts: true, goog:chromeOptions: {debuggerAddress: localhost:44789}, networkConnectionEnabled: false, pageLoadStrategy: normal, platformName: linux, proxy: Proxy(manual, http=nx.testdomain..., se:bidiEnabled: false, se:cdp: ws://172.18.0.24:4444/sessi..., se:cdpVersion: 127.0.6533.119, se:vnc: ws://172.18.0.24:4444/sessi..., se:vncEnabled: true, se:vncLocalAddress: ws://172.18.0.24:7900, setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify, webauthn:extension:credBlob: true, webauthn:extension:largeBlob: true, webauthn:extension:minPinLength: true, webauthn:extension:prf: true, webauthn:virtualAuthenticators: true}


###### 2、these are standalone-firefox's log

12:08:56.213 INFO [LocalDistributor.newSession] - Session request received by the Distributor: 
 [Capabilities {acceptInsecureCerts: true, browserName: firefox, moz:debuggerAddress: true, moz:firefoxOptions: {}, proxy: {httpProxy: nx.testdomain.com:24000, proxyType: manual}}]
12:08:58.553 INFO [LocalNode.newSession] - Session created by the Node. Id: d97c5984-027f-4793-afeb-f8913ce4668f, Caps: Capabilities {acceptInsecureCerts: true, browserName: firefox, browserVersion: 129.0.1, moz:accessibilityChecks: false, moz:buildID: 20240812083845, moz:debuggerAddress: true, moz:firefoxOptions: {}, moz:geckodriverVersion: 0.35.0, moz:headless: false, moz:platformVersion: 5.15.0-119-generic, moz:processID: 35273, moz:profile: /tmp/rust_mozprofileIlS6Zj, moz:shutdownTimeout: 60000, moz:webdriverClick: true, moz:windowless: false, pageLoadStrategy: normal, platformName: linux, proxy: Proxy(manual, http=nx.testdomain..., se:bidiEnabled: false, se:cdp: ws://172.18.0.23:4444/sessi..., se:containerName: , se:noVncPort: 7900, se:vnc: ws://172.18.0.23:4444/sessi..., se:vncEnabled: true, se:vncLocalAddress: ws://172.18.0.23:7900, setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify, userAgent: Mozilla/5.0 (X11; Linux x86...}
12:08:58.554 INFO [LocalDistributor.newSession] - Session created by the Distributor. Id: d97c5984-027f-4793-afeb-f8913ce4668f 
 Caps: Capabilities {acceptInsecureCerts: true, browserName: firefox, browserVersion: 129.0.1, moz:accessibilityChecks: false, moz:buildID: 20240812083845, moz:debuggerAddress: true, moz:firefoxOptions: {}, moz:geckodriverVersion: 0.35.0, moz:headless: false, moz:platformVersion: 5.15.0-119-generic, moz:processID: 35273, moz:profile: /tmp/rust_mozprofileIlS6Zj, moz:shutdownTimeout: 60000, moz:webdriverClick: true, moz:windowless: false, pageLoadStrategy: normal, platformName: linux, proxy: Proxy(manual, http=nx.testdomain..., se:bidiEnabled: false, se:cdp: ws://172.18.0.23:4444/sessi..., se:containerName: , se:noVncPort: 7900, se:vnc: ws://172.18.0.23:4444/sessi..., se:vncEnabled: true, se:vncLocalAddress: ws://172.18.0.23:7900, setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify, userAgent: Mozilla/5.0 (X11; Linux x86...}

Operating System

Ubuntu

Selenium version

latest

What are the browser(s) and version(s) where you see this issue?

browserName: chrome, browserVersion: 127.0.6533.119

What are the browser driver(s) and version(s) where you see this issue?

chromedriverVersion: 127.0.6533.119

Are you using Selenium Grid?

No response

Copy link

@markxsq, thank you for creating this issue. We will troubleshoot it as soon as we can.


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

@diemol
Copy link
Member

diemol commented Nov 5, 2024

Each browser behaves differently. You can post the question to Mozilla.

@diemol diemol added G-geckodriver Requires fixes in GeckoDriver and removed needs-triaging labels Nov 5, 2024
Copy link

github-actions bot commented Nov 5, 2024

Hi, @Ninjaxsh.
This issue has been determined to require fixes in GeckoDriver.

You can see if the feature is passing in the Web Platform Tests.

If it is something new, please create an Issue with the GeckoDriver team.

Feel free to comment the issues that you raise back in this issue. Thank you.

@github-actions github-actions bot closed this as completed Nov 5, 2024
Copy link

github-actions bot commented Dec 5, 2024

This issue has been automatically locked since there has not been any recent activity since it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked and limited conversation to collaborators Dec 5, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
G-geckodriver Requires fixes in GeckoDriver I-defect
Projects
None yet
Development

No branches or pull requests

2 participants