Exceptions and Proxy servers handling in firefox

In order to handle exceptions using firefox driver we create a new profile

ProfilesIni allprof = new ProfilesIni();
FirefoxProfile prof = allprof.getProfile("Mod11");
FirefoxOptions options =  new FirefoxOptions();    
options.setProfile(prof);

For wedriver to handle them we use these two simple commands

prof.setAcceptUntrustedCertificates(true);
prof.setAssumeUntrustedCertificateIssuer(false);

Sometimes we use proxy servers to connect to internet. Like for example we are sitting in canada but connect to proxy server from states or uk etc to connect to internet.So to deal with proxies we do this.

To use a proxy server use the below commands

prof.setPreference("network.proxy.type", 1);
prof.setPreference("network.proxy.socks", "83.209.94.87");
prof.setPreference("network.proxy.socks_port", 35923);

And then pass this object we created options into constructer of firefoxdriver.

FirefoxDriver driver1 =  new FirefoxDriver(options);