How to install Firefox add-ons using selenium web driver in cucumber tests

I need to write a script where I need to install firefox-add-on named is aqqin. How can i do this

+4
source share
2 answers

selenium with ruby ​​code:

RSpec.configure do |config| profile = Selenium::WebDriver::Firefox::Profile.new profile.assume_untrusted_certificate_issuer = true #profile.add_extension "/usr/lib/firefox-addons/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}" Capybara.register_driver :selenium do |app| Capybara::Selenium::Driver.new(app, {:browser => :firefox, :profile => "default"} ) #Capybara::Selenium::Driver.new(app, {:browser => :firefox, :profile => profile} ) end end 
+1
source

You can add add-ons by creating a custom profile and passing it to the driver.

 FirefoxProfile profile = new FirefoxProfile(); File extension = new File("<path>"/aqqin.xpi"); profile.addExtension(extension); WebDriver driver = new FirefoxDriver(profile); 
+4
source

All Articles