I am using webdriver and my requirement is to modify headers on the go. Since it is not a native functionality of the webdriver, I am using firefox extension modifyheaders to get the job done. However, I have been unsuccessful in modify the header values. My code:
FirefoxProfile profile = new FirefoxProfile ();
profile.setPreference("network.proxy.socks", "
socks.com");
profile.setPreference("network.proxy.socks_port", 10);
profile.setPreference("network.proxy.type", 1);
profile.addExtension(new File("C:/Selenium/modify_headers-0.7.1.1-fx.xpi"));
profile.setPreference("modifyheaders.config.active", true);
profile.setPreference("modifyheaders.config.openNewTab", true);
profile.setPreference("modifyheaders.config.migrated", true);
profile.setPreference("modifyheaders.config.alwaysOn", true);
profile.setPreference("modifyheaders.headers.count", 1);
profile.setPreference("modifyheaders.headers.action0", "Add");
profile.setPreference("modifyheaders.headers.name0", "X-Forwarded-For");
profile.setPreference("modifyheaders.headers.value0", "192.168.1.6");
profile.setPreference("modifyheaders.headers.enabled0", true);
I found this code from a few examples, but somehow this doesnot seem to be working here. What am I doing wrong here? Also, where can I find a copy of the extenxion .xpi file?