Skip to content

Commit a2235cd

Browse files
titusfortnerdiemol
andauthored
[java] support Selenium Manager using proxy info from options (#12036)
[py] support Selenium Manager using proxy info from options Co-authored-by: Diego Molina <[email protected]>
1 parent f3316d9 commit a2235cd

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

java/src/org/openqa/selenium/manager/SeleniumManager.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import org.openqa.selenium.Beta;
2222
import org.openqa.selenium.Capabilities;
2323
import org.openqa.selenium.Platform;
24+
import org.openqa.selenium.Proxy;
2425
import org.openqa.selenium.WebDriverException;
2526
import org.openqa.selenium.json.Json;
2627

@@ -218,6 +219,17 @@ public String getDriverPath(Capabilities options) {
218219
commandList.add(browserBinary);
219220
}
220221

222+
Proxy proxy = (Proxy) options.getCapability("proxy");
223+
if (proxy != null) {
224+
if (proxy.getSslProxy() != null) {
225+
commandList.add("--proxy");
226+
commandList.add(proxy.getSslProxy());
227+
} else if (proxy.getHttpProxy() != null) {
228+
commandList.add("--proxy");
229+
commandList.add(proxy.getHttpProxy());
230+
}
231+
}
232+
221233
if (getLogLevel().intValue() <= Level.FINE.intValue()) {
222234
commandList.add("--debug");
223235
}

0 commit comments

Comments
 (0)