Weberiver 运行时开启Firebug

1.打开Firefox浏览器.在浏览器地址栏输入about:config

在Search栏中输入: firebug.allPagesActivation

2.设置extentsion.firebug.allPagesActivation的Value值为on

3.在程序中设置:


//设置Firebug路径

File file=new File("C:\\webdriver\\firebug-2.0.17.xpi");
FirefoxProfile profile = new FirefoxProfile();

profile.setPreference("network.proxy.type", 2);

//自动代理配置

profile.setPreference("network.proxy.autoconfig_url", "http://proxy.successfactors.com:8083")

          try {

                //add firebug

                profile.addExtension(file);

                //设置firebug 版本

                profile.setPreference("extensions.firebug.currentVersion", "2.0.17");
                //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);
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值