Watir-WebDriver tests on Firefox 7: getting rid of the send data to Mozilla message

Update 6 October 2011: The send data to Mozilla question will be turned off by default in the next release (2.8.0) of the selenium-webdriver gem which watir-webdriver uses.

I’ve been running Watir-WebDriver tests against Firefox 7, which works superbly. The biggest change is Firefox 7 now supports performance metrics, so this means you can use the watir-webdriver-peformance gem: yay! It also means my EtsyWatirWebDriver project now collects page metrics using Firefox.

The only slight annoyance is the presence of the ‘send data to Mozilla?’ dialog bar. Never fear, it’s easily dismissed.

require 'watir-webdriver'
profile = Selenium::WebDriver::Firefox::Profile.new
profile['toolkit.telemetry.prompted'] = true
b = Watir::Browser.new :firefox, :profile => profile

Enjoy.

Send data to mozilla

Author: Alister Scott

Alister is an Excellence Wrangler for Automattic.

4 thoughts on “Watir-WebDriver tests on Firefox 7: getting rid of the send data to Mozilla message”

  1. Thanks,

    I still seem to get the toolbar prompt asking to send metrics. I am also setting the default timeout to be larger for client, which is slightly different then your example:

    client = Selenium::WebDriver::Remote::Http::Default.new
    client.timeout = 120 # seconds – default is 60
    driver = Selenium::WebDriver.for(:firefox, :http_client => client)

    profile = Selenium::WebDriver::Firefox::Profile.new
    profile.native_events = false
    profile[‘toolkit.telemetry.prompted’] = true

    b = Watir::Browser.new(driver, :profile => profile)

    Thanks,

    JC

    Like

    1. I’m not sure whether it’s because you’re creating a driver as well as a browser? I haven’t seen that done before. I’d rather pass the http client to the browser.

      client = Selenium::WebDriver::Remote::Http::Default.new
      client.timeout = 120 # seconds – default is 60
      
      profile = Selenium::WebDriver::Firefox::Profile.new
      profile.native_events = false
      profile['toolkit.telemetry.prompted'] = true
      
      b = Watir::Browser.new driver, :profile => profile, :http_client => client
      

      Like

      1. Thanks, I was just about to post. I got it working with the following:

        client = Selenium::WebDriver::Remote::Http::Default.new
        client.timeout = 120 # seconds – default is 60

        profile = Selenium::WebDriver::Firefox::Profile.new
        profile.native_events = false
        profile[‘toolkit.telemetry.prompted’] = true

        driver = Selenium::WebDriver.for(:firefox, {:http_client => client, :profile => profile})

        b = Watir::Browser.new(driver)

        Thanks,

        JC

        Like

    2. Hi Alister,

      Unfortunately the solution doesn’t work for me. Having a quick browse on Google I even tried to do profile[‘toolkit.telemetry.prompted’] = 2 as some people suggested but it doesn’t seem to work either. I am on Firefox 9 but it still seems to exist in this version. Any ideas? using selenium-webdriver 2.18.0

      Like

Comments are closed.