You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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);
} elseif (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;
}
@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.
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?
Relevant log output
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
The text was updated successfully, but these errors were encountered: