当我们需要在用firefox进行测试时启动firebug,可以使用下面的代码
当有些网页加载比较慢。比如新浪微博。有时候需要几分钟,其实几秒页面就已经渲染好了。
像这种情况。如果不像让它加载的话,可以使用插件
killspinners、
1.这是动态设置插件。
File file = new File("xpi\\firebug-1.8.1.xpi");
FirefoxProfile firefoxProfile = new FirefoxProfile();
firefoxProfile.addExtension(file);
firefoxProfile.setPreference("extensions.firebug.currentVersion", "1.8.1");
2.这是启动默认浏览器
WebDriver driver = new FirefoxDriver(firefoxProfile);
以此类推,当我们需要启用别的扩展程序时,换下文件就可以了
启动默认的浏览器
ProfilesIni allProfiles = new ProfilesIni();
FirefoxProfile firefoxProfile = allProfiles.getProfile("default");