Note that there are some explanatory texts on larger screens.

plurals
  1. POSelenium2 firefox: use the default profile
    text
    copied!<p>Selenium2, by default, starts firefox with a fresh profile. I like that for a default, but for some good reasons (access to my bookmarks, saved passwords, use my add-ons, etc.) I want to start with my default profile.</p> <p>There is <a href="http://code.google.com/p/selenium/wiki/FirefoxDriver" rel="nofollow noreferrer">supposed to be</a> a property controlling this but I think the docs are out of sync with the source, because as far as I can tell <code>webdriver.firefox.bin</code> is the only one that works. E.g. starting selenium with:</p> <pre><code>java -jar selenium-server-standalone-2.5.0.jar -Dwebdriver.firefox.bin=not-there </code></pre> <p>works (i.e. it complains). But this has no effect:</p> <pre><code>java -jar selenium-server-standalone-2.5.0.jar -Dwebdriver.firefox.profile=default </code></pre> <p>("default" is the name in profiles.ini, but I've also tried with "Profile0" which is the name of the section in profiles.ini).</p> <p>I'm using <a href="http://code.google.com/p/php-webdriver-bindings/" rel="nofollow noreferrer">PHPWebdriver</a> (which uses JsonWireProtocol) to access:</p> <pre><code>$webdriver = new WebDriver("localhost", "4444"); $webdriver-&gt;connect("firefox"); </code></pre> <p>I tried doing it from the PHP side:</p> <pre><code>$webdriver-&gt;connect("firefox","",array('profile'=&gt;'default') ); </code></pre> <p>or:</p> <pre><code>$webdriver-&gt;connect("firefox","",array('profile'=&gt;'Profile0') ); </code></pre> <p>with no success (firefox starts, but not using my profile).</p> <p>I also tried the hacker's approach of creating a batch file:</p> <pre><code>#!/bin/bash /usr/bin/firefox -P default </code></pre> <p>And then starting Selenium with: java -jar selenium-server-standalone-2.5.0.jar -Dwebdriver.firefox.bin="/usr/local/src/selenium/myfirefox" </p> <p>Firefox starts, but not using by default profile and, worse, everything hangs: selenium does not seem able to communicate with firefox when started this way.</p> <p>P.S. I saw <a href="https://stackoverflow.com/questions/3650506/selenium-custom-firefox-profile">Selenium - Custom Firefox profile</a> I tried this:</p> <pre><code>java -jar selenium-server-standalone-2.5.0.jar -firefoxProfileTemplate "not-there" </code></pre> <p>And it refuses to run! Excited, thinking I might be on to something, I tried:</p> <pre><code>java -jar selenium-server-standalone-2.5.0.jar -firefoxProfileTemplate /path/to/0abczyxw.default/ </code></pre> <p>This does nothing. I.e. it still starts with a new profile :-(</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload