4

I am looking for how to change foxyproxy's settings in Selenium WebDriver from Java. My code is the following currently.

FirefoxProfile profile = new FirefoxProfile();

File foxyproxy = new File("path to foxyproxy.xpi");
try {
    profile.addExtension(foxyproxy);
} catch (IOException e) {
}

File binaryfile = new File("path to firefox.exe");
FirefoxBinary profile = new FirefoxBinary(binaryfile);

WebDriver driver = new WebDriver(binary, profile);
...

I could check that addExtension() is no problem when selenium was executed.

But, After that I have no idea to change foxyproxy's settings. I would like to set some proxy's rule.

For example, can I use setPreference() by using a specified key and value for foxyproxy?

profile.setPreference("key", "value");

If you have a solution, could you instruct me?

Thank you for your attention.

Ripon Al Wasim
  • 36,924
  • 42
  • 155
  • 176
tacky
  • 41
  • 4
  • If you go to `about:config` in Firefox, are FoxyProxy's settings stored in this long list? If yes, you change them, otherwise no. – Arran Feb 04 '13 at 09:29
  • Thank you for the reply. Sorry, where is `about:config`? I can't found it... – tacky Feb 04 '13 at 12:03
  • in the URL browser, simply input: `about:config` and go to it. Firefox will give you a warning. Search the list, can you see any FoxyProxy's settings? This is the list of settings that Selenium can interact with. If it's not there, then you'll have to contact the FoxyProxy author to ask *where* the settings are located, because best practices dictates they *should* be in the `about:config`. http://kb.mozillazine.org/About:config – Arran Feb 04 '13 at 15:50
  • I found "network.proxy.autoconfig_url" instead of FoxyProxy by checking `about:config`. It seems to be easier than FoxyProxy. I tried this param. But, it couldn't reflect on Firefox when Selenium RC starts automatically. In general, it needs to push reload-button manually in options window. But, the case of Selenium RC, it should be reflected automatically. How should it be carried out? – tacky Feb 06 '13 at 12:20
  • This problem was resolved by myself. Thank you! – tacky Feb 21 '13 at 13:51

0 Answers0