ruby - How to access Firefox Extension I added in Selenium Webdriver? -
i know can load either existing firefox profile, or create 1 using ruby bindings in selenium-webdriver gem, described here:
http://code.google.com/p/selenium/wiki/rubybindings
and use add_extension
add number of firefox extensions instance, what? window extension i'm using not appear during test. how use extension?
is there way have extension open default when driver opens firefox?
here code i'm using:
#!/usr/bin/env ruby require "rubygems" require "selenium-webdriver" default_profile = selenium::webdriver::firefox::profile.from_name "default" default_profile.add_extension("/users/******/library/application support/firef\ ox/profiles/wvon3h99.default/extensions/{9c51bd27-6ed8-4000-a2bf-36cb95c0c947}.\ xpi") driver = selenium::webdriver.for(:firefox, :profile => default_profile) driver.navigate.to "http://google.com" element = driver.find_element(:name, 'q') element.send_keys "hello webdriver!" element.submit puts driver.title driver.quit
it depends on extension. extension's behaviour can extent controlled setting appropriate properties (the ones can find in about:config) when creating ff profile. instance have firebug window open default after ff starts include following line in code:
default_profile["extensions.firebug.allpagesactivation"] = true
the extensions use have kind of auto-export feature automatically sends data server or saves on disk. afraid there no way of controlling extension webdriver not extensions usable in automated tests.
Comments
Post a Comment