本文是对上一节的补充: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. java ffmpeg视频转码(自测通过)

    import java.io.*; public class VideoTransfer { //ffmepg文件 安装目录 private static String ffmpeg = " ...

  2. iOS objc_msgSend 报错解决方案

    错误代码: objc_msgSend(self.beginRefreshingTaget, self.beginRefreshingAction, self); Too many arguments ...

  3. vs已停止工作

    第一步: 开始-->所有程序-->Microsoft Visual Studio 2012-->VisualStudio Tools-->VS2012 开发人员命令提示(以管理 ...

  4. docker查看容器的网络ip

    docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' container_name_or_id 可直 ...

  5. Asp.Net中使用Couchbase——Memcached缓存入门篇

    本文个人同步博客地址: http://aehyok.com/Blog/Detail/96.html 个人网站地址:aehyok.com QQ 技术群号:206058845,验证码为:aehyok 本文 ...

  6. MAPI错误0x80040107

    MAPI错误0x80040107  的解决方案: The MAPI error means there's an "invalid entry" within the contac ...

  7. [转]MySQL导入.sql文件及常用命令

    From : http://blog.csdn.net/muziduoxi/article/details/6091202 在MySQL Qurey   Brower中直接导入*.sql脚本,是不能一 ...

  8. Netty 4.0.0.CR6 发布,高性能网络服务框架

    Netty 4.0 发布第 6 个 RC 版本,该版本值得关注的改进有: SslHandler and JZlibEncoder now works correctly. (#1475 and #14 ...

  9. Guava CaseFormat

    概述 CaseFormat用来转换各种不同的编程语言间的变量名命名格式, 主要用到的方法只有一个 CaseFormat.to(CaseFormat from, String s) CaseFormat ...

  10. HDOJ 4869 Turn the pokers

    最后的结果中正面向上的奇偶性是一定的,计算出正面向上的范围low,up 结果即为 C(m.low)+ C(m.low+2) +.... + C(m,up) ,用逆元取模 Turn the pokers ...