1.打开Firefox浏览器.在浏览器地址栏输入about:config
在Search栏中输入: firebug.allPagesActivation
2.设置extentsion.firebug.allPagesActivation的Value值为on
3.在程序中设置:
//设置Firebug路径
FirefoxProfile profile = new FirefoxProfile();
profile.setPreference("network.proxy.type", 2);
//自动代理配置
profile.setPreference("network.proxy.autoconfig_url", "http://proxy.successfactors.com:8083")
try {
profile.addExtension(file);
//设置firebug 版本
//active firebug extensions
profile.setPreference("extensions.firebug.allPagesActivation", "on");
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
WebDriver driver = new FirefoxDriver(profile);
driver.get("http://www.baidu.com");
Actions actions=new Actions(driver);
driver.manage().window().maximize();
driver.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS);
driver.manage().timeouts().pageLoadTimeout(30, TimeUnit.SECONDS);