本文是对上一节的补充:http://www.cnblogs.com/puresoul/p/4251536.html

使用Selenium2(webdriver)启动firefox且自动加载firebug插件时,切换到firebug插件的网络和cookies部分时,提示面板已被禁用,如下图所示:

于是我们输入about:config在firefox设置页面试着去找下是否有什么参数控制着面板的禁用/启用,果然被我找到如下两个参数:

  • cookies面板 ---  extensions.firebug.cookies.enableSites
  • 网络面板   ---  extensions.firebug.net.enableSites

Tips:

  firefox设置页面参数非常的多,如果我们不知道某项设置的参数名时,我们可以手工在firefox界面设置参数的值,然后根据我们定制的值去about:config里面找就可以找到,从而找到我们要设置的参数。

在代码中设置这两个参数的值为true,运行结果如下:

代码如下:

     public static void StartFireFoxLoadPlugin(){
System.out.println("start firefox browser...");
System.setProperty("webdriver.firefox.bin",
"D:/Program Files/Mozilla Firefox/firefox.exe");
File file = new File("files/firebug-1.9.0-fx.xpi");
FirefoxProfile profile = new FirefoxProfile();
try {
profile.addExtension(file);
} catch (IOException e) {
e.printStackTrace();
}
//设置firebug版本
profile.setPreference("extensions.firebug.currentVersion", "1.9.0");
//自动打开firebug
profile.setPreference("extensions.firebug.allPagesActivation", "on");
//设置启用firebug网络面板
profile.setPreference("extensions.firebug.net.enableSites", true);
//设置启用firebugcookies面板
profile.setPreference("extensions.firebug.cookies.enableSites", true); WebDriver driver = new FirefoxDriver(profile);
driver.get("http://www.baidu.com");
System.out.println("start firefox browser succeed...");
}

Selenium2(WebDriver)总结(二)---Firefox的firebug插件参数设置(补充)的更多相关文章

  1. Android进阶(二十五)setTextColor()的参数设置方式

    setTextColor()的参数设置方式 查了下资料发现setTextColor()的参数可以写成以下形式: 直接使用颜色值 setTextColor(0xFF0000FF);//0xFF0000F ...

  2. Selenium2(WebDriver)总结(一)---启动浏览器、设置profile&加载插件

    本文主要记录下在使用selenium2/webdriver时启动各种浏览器的方法.以及如何加载插件.定制浏览器信息(设置profile)等 环境搭建可参考我的另一篇文章:http://www.cnbl ...

  3. selenium2 Webdriver + Java 自动化测试实战和完全教程

    selenium2 Webdriver + Java 自动化测试实战和完全教程一.快速开始 博客分类: Selenium-webdriverselenium webdriver 学习selenium ...

  4. Selenium1(RC)与Selenium2(WebDriver)的概念介绍

    最近网上学习了Selenium1和selenium2,自己做一些总结,方便以后查阅. 部分内容引用: http://www.cnblogs.com/hyddd/archive/2009/05/30/1 ...

  5. XPath Checker 和 firebug 插件使用

    安装插件: 1.firebug 2.FirePath 3.xpath finder 4.XPath Checker XPath Checker 下载安装 https://addons.mozilla. ...

  6. 前端开发必备调试工具(Chrome的F12自带的功能和firebug插件差不多)

    前端开发必备调试工具(Chrome的F12自带的功能和firebug插件差不多) 一.总结 Chrome的F12自带的功能和firebug插件差不多 二.前端开发必备调试工具 在前端开发中我们经常会要 ...

  7. Selenium2学习-042-Selenium3启动Firefox Version 48.x浏览器(ff 原生 geckodriver 诞生)

    今天又被坑了一把,不知谁把 Slave 机的火狐浏览器版本升级为了 48 的版本,导致网页自动化测试脚本无法启动火狐的浏览器,相关的网页自动化脚本全线飘红(可惜不是股票,哈哈哈...),报版本不兼容的 ...

  8. 巧妙使用Firebug插件,快速监控网站打开缓慢的原因

    原文 巧妙使用Firebug插件,快速监控网站打开缓慢的原因 很多用户会问,我的网站首页才50KB,打开网页用了近60秒才打开?如何解释? 用户抱怨服务器运行缓慢,w3wp.exe 出现 CPU 10 ...

  9. selenium2(WebDriver) API

    selenium2(WebDriver) API 作者:Glen.He出处:http://www.cnblogs.com/puresoul/  1.1  下载selenium2.0的包 官方downl ...

随机推荐

  1. iOS 实现复选框 checkbox

    -(void)checkboxClick:(UIButton *)btn{    btn.selected = !btn.selected;} - (void)viewDidLoad {UIButto ...

  2. WordPress主题开发:数据调用

    记录在开发过程中常用的 引入标签:在一个模板文件里引用另外一个文件 get_header() get_footer() get_sidebar() get_template_part() get_se ...

  3. 数据访问:Implementing Efficient Transactions

    An OLTP scenario is characterized by a large number of concurrent operations that create, update, an ...

  4. 架构:The Clean Architecture(整洁的架构)(转载)

    地址:http://blog.8thlight.com/uncle-bob/2012/08/13/the-clean-architecture.html. Over the last several ...

  5. 如何删除mac keeper

    如果不小心安装了mac keeper,基本是无法删除的,而且16年以前的方法都不管用.可以这样删除,我已经测试过了,下载https://data-cdn.mbamupdates.com/web/mba ...

  6. 使用DDMS中的内存监测工具Heap来优化内存

    最近在做一个照片墙的应用,涉及到很多知识,其中难点在于如何应对数量庞大的图片,这就涉及到内存管理的知识了.今天介绍的工具是DDMS中自带的Heap,它可以显示出当前引用占用的内存,剩余的内存等信息.下 ...

  7. Easyui 页面设置加载完成之后,满屏

    js文件: if(top.location!=self.location){ top.location.href=self.location; }

  8. 零基础写python爬虫之使用Scrapy框架编写爬虫

    网络爬虫,是在网上进行数据抓取的程序,使用它能够抓取特定网页的HTML数据.虽然我们利用一些库开发一个爬虫程序,但是使用框架可以大大提高效率,缩短开发时间.Scrapy是一个使用Python编写的,轻 ...

  9. HTTP tunnel

    HTTP Tunneling is a technique by which communications performed using various network protocols are ...

  10. 基于JAVA原生HTTP请求工具类 httphelper

    原文地址;http://lushuifa.iteye.com/blog/2313896 import java.io.BufferedReader; import java.io.BufferedWr ...