Skip to content

Commit a89f759

Browse files
committed
[py] support Selenium Manager using proxy info from options
1 parent 2a6b075 commit a89f759

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

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)