4

I know that with watir-WebDriver, I can make use of RubyBindings to have the browser load specific profiles or Firefox add-ons when I create a new browser instance. However, can I use Watir to actually use the add-on(s) I open?

The reason I ask is that I am trying to implement a web scraper to navigate to websites and record HTTP interactions. However, since Tamper Data already does the HTTP request/response logging I require, I'd rather use its functionality instead of having to redo it myself.

If this is not possible, I'm wondering if anyone knows a unit tester that will allow me to:

  1. Open a Firefox browser & load Tamper Data
  2. Navigate to specified pages
  3. Click a button on Tamper Data's UI
Kotsu
  • 374
  • 1
  • 5
  • 22

2 Answers2

3

You can't interact with extensions using bare watir/webdriver as far as i know, need to find a workaround ... Try something like rautomation - https://github.com/jarmo/RAutomation or autoit - http://www.autoitscript.com/site/

Johny Cash
  • 56
  • 3
0

This works for me to launch firebug:

Win 7 & XP:

require 'watir-webdriver'
default = Watir::WebDriver::Firefox::Profile.new

If you are admin on your machine it will be the following... otherwise search and provide path:

default.add_extension("/Users/Administrator/AppData/Roaming/Mozilla/Firefox/Profiles/krqve9uc.firebug/extensions/firebug@software.joehewitt.com.xpi")
b = Watir::Browser.new(:firefox, :profile => default)
Nat Ritmeyer
  • 5,634
  • 8
  • 45
  • 58
  • 1
    This doesn't answer my question. Like I said, I realize that I can load extensions/add-ons, but how do I actually interact with those extensions/add-ons? – Kotsu Aug 01 '11 at 16:00
  • Kotsu, did you find a solution? I'm having a similar issue (I need to interact with an AddOn) – Dorian Nov 17 '11 at 10:25
  • @Dorian Sorry about this incredibly late (and probably not to useful) response, but since I was developing on an OSX platform, I ended up implementing a ruby script using the rb-appscript library to launch Firefox and select my add-on. – Kotsu Jul 23 '12 at 15:55