Unable to use existing profile with webdriver

74 views
Skip to first unread message

Greg Allen

unread,
Jan 16, 2015, 2:36:23 PM1/16/15
to seleniu...@googlegroups.com
I am using Selenium webdriver 2.44.

I have created a FireFox profile that configures a proxy server and also adds an entry to the password manager. If I start FF and point at this profile things work fine.  However, when I try to run FF using the webdriver, the profile does not work.  Here's my command:

driver = Selenium::WebDriver.for(:firefox, :profile => 'test-profile')

I have done some debugging of the profile code that comes with the webdriver, and I can see that the contents of the profile are being copied to the webdriver version of the profile. I have verified that the files are still there at the end of the launch method (selenium-webdriver-2.44.0/lib/selenium/webdriver/firefox/launcher.rb).

However, when the driver actually starts the profile files are deleted and other profile files are taking their place, meaning my profile isn't really used. Some changes do seem to be there, as my preference changes to set up the proxy seem to have taken effect. However, the logins.json file is not there, and the key3.db file has been overwritten with a generic one - both of these files are in the initial profile I specified.

I also tried this with similar results:

test_profile = Selenium::WebDriver::Firefox::Profile.from_name "test-profile"
driver = Selenium::WebDriver.for(:firefox, :profile => test_profile)

How can I get these files included in the profile that the webdriver is going to use?

Thanks!

Serguei Kouzmine

unread,
Feb 22, 2015, 10:13:34 PM2/22/15
to seleniu...@googlegroups.com
C# 
[string]$profile_directory = '...\6us7lrj6.Selenium'
$profile = New-Object OpenQA.Selenium.Firefox.FirefoxProfile ($profile_directory)
$selenium = New-Object OpenQA.Selenium.Firefox.FirefoxDriver ($profile)

java
DesiredCapabilities capabilities = new DesiredCapabilities();
FirefoxProfile profile = new FirefoxProfile();
capabilities.setCapability(FirefoxDriver.PROFILE, profile);
Reply all
Reply to author
Forward
0 new messages