Hello,
Wondering if its possible to configure a browser to use an external proxy in the nodeConfig.json capabilities section. So far I have not been able to make this work.
capabilities [
{
"browserName": "chrome",
"platform": "LINUX",
"acceptSslCerts": true,
"javascriptEnabled": true,
"takesScreenshot": true,
"maxInstances": 5,
"cleanSession": true,
"proxy": {
"httpProxy": "localhost:8118",
"proxyType": "manual",
"sslProxy": "localhost:8118"
}
}
]
14:35:48.181 INFO [ActiveSessionFactory.apply] - Capabilities are: {
"browser": "chrome",
"browserName": "chrome",
"goog:chromeOptions": {
"args": [
"--headless",
"--disable-gpu"
],
"extensions": [
]
},
"platform": "LINUX"
}
So the above is missing the proxy capability. When I specify the capability in my code like so:
Proxy proxy = new Proxy();
proxy.setHttpProxy("localhost:8118");
proxy.setSslProxy("localhost:8118");
DesiredCapabilities caps = new DesiredCapabilities();
caps.setCapability("browser", "chrome");
caps.setPlatform(Platform.LINUX);
//caps.setCapability(CapabilityType.TAKES_SCREENSHOT, true);
ChromeOptions options = new ChromeOptions();
options.merge(caps);
options.setHeadless(true);
options.setCapability(CapabilityType.PROXY, proxy);
I see the following from the node log:
14:38:25.128 INFO [ActiveSessionFactory.apply] - Capabilities are: {
"browser": "chrome",
"browserName": "chrome",
"goog:chromeOptions": {
"args": [
"--headless",
"--disable-gpu"
],
"extensions": [
]
},
"platform": "LINUX",
"proxy": {
"httpProxy": "localhost:8118",
"proxyType": "manual",
"sslProxy": "localhost:8118"
}
}
So looking for help in understanding if its possible, and if so what I am doing wrong.
Thanks!
Jeremy