Mateu
Mateu

Reputation: 2698

How to set a firefox profile on a Selenium WebDriver remote with Ruby

I want to set a Firefox profile to the following driver:

driver = Selenium::WebDriver.for :remote, :url => "http://localhost:4444/wd/hub", :desired_capabilities => :firefox

I've tried adding:

profile = Selenium::WebDriver::Firefox::Profile.new
profile['browser.download.downloadDir'] = '/home/seluser'
driver = Selenium::WebDriver.for :remote, :url => "http://localhost:4444/wd/hub", :desired_capabilities => :firefox, :profile => profile

But the profile option does not exist

Thanks

Upvotes: 5

Views: 3835

Answers (1)

Saurabh Gaur
Saurabh Gaur

Reputation: 23805

You should try as below :-

profile = Selenium::WebDriver::Firefox::Profile.new
profile['browser.download.downloadDir'] = '/home/seluser'

capabilities = Selenium::WebDriver::Remote::Capabilities.firefox(:firefox_profile => profile)

driver = Selenium::WebDriver.for :remote, :url => "http://localhost:4444/wd/hub", :desired_capabilities => capabilities

Note :- You should follow this to learn more about Ruby binding.

Hope it will help you...:)

Upvotes: 3

Related Questions