Skip to content
Wai Hon Law edited this page May 30, 2014 · 4 revisions

FirefoxProfile is the class managing the firefox profile. You can find more details in https://code.google.com/p/selenium/wiki/FirefoxDriver. Here is the guide of using FirefoxProfile in facebook/php-webdirver.

Create an instance of FirefoxProfile

$profile = new FirefoxProfile();

Set Preferences

// Let's set the start up home page to github.com/facebook/php-webdriver !
$profile->setPreference(
  'browser.startup.homepage',
  'https://github.com/facebook/php-webdriver/'
);

This page includes other useful preferences. http://kb.mozillazine.org/About:config_entries

Launch with Firefox extensions

$profile->addExtension('/path/to/firefox/extension1.xpi')
        ->addExtension('/path/to/firefox/extension2.xpi');

Starting Firefox with the above configuration

$caps = DesiredCapabilities::firefox();
$caps->setCapability(FirefoxDriver::PROFILE, $profile);

$driver = RemoteWebDriver::create($url, $caps);

Clone this wiki locally