2

I am trying to setup a socks5 proxy in ChromeDriver. I have used the below code for setting that up in C#:

var options = new ChromeOptions();

var proxy = new Proxy() { Kind=ProxyKind.Manual, IsAutoDetect = false, SocksProxy = "proxy url with port number", SocksUsername = username, SocksPassword = password };

options.Proxy = proxy;

var chrome = new ChromeDriver(options);

The above code is giving below exception:

System.InvalidOperationException: 'unknown error: cannot parse capability: proxy from unknown error: proxyType is 'manual' but no manual proxy capabilities were found

I have also tried adding socks5 proxy using options.AddArguments but that is also not working.

Can someone help solving this please?

1
  • This is more of a programming question, can you please try asking on stackoverflow? Not Software Quality Assurance & Testing? – Yu Zhang Dec 8 '17 at 20:11
1

I'm using the nuget packages for Selenium 2.50.1 with this:

ChromeOptions options = new ChromeOptions(); 
proxy = new Proxy(); 
proxy.Kind = ProxyKind.Manual; 
proxy.IsAutoDetect = false; 
proxy.HttpProxy = proxy.SslProxy = "127.0.0.1:3330"; 
options.Proxy = proxy; 
options.AddArgument("ignore-certificate-errors"); 
var chromedriver = new ChromeDriver(options);

If your proxy requires user log in, you can set the proxy with login user/password details as below:

options.AddArguments("--proxy-server=http://user:password@yourProxyServer.com:8080");

Not the answer you're looking for? Browse other questions tagged or ask your own question.