burzum burzum - 1 month ago 16
PHP Question

php & Selenium - Firefox always opens welcome page (FF 49.0.2, SE 2.53.1)

I've read this question and answer on Stackoverflow. And this page. I've also read this page. I've also found this issue which doesn't resolved my problem either.

I'm using Selenium 2.53.1, FF 49.0.2 on Windows 10. Here is my code for the Facebook Webdriver, it's basically their example just extended by the profile settings:

$profile = new FirefoxProfile();
$profile->setPreference('browser.startup.homepage_override.mston', 'ignore');
$profile->setPreference('startup.homepage_welcome_url.additional', 'about:blank');
$profile->setPreference('browser.startup.homepage', 'about:blank');
$profile->setPreference('xpinstall.signatures.required', false);

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

$driver = RemoteWebDriver::create('http://localhost:4444/wd/hub', $capabilities, 4444);

$driver->get('http://docs.seleniumhq.org/');


But I'm still getting this:

image

Am I doing something wrong?

Answer

There's an e missing at the end of mston. I would also set the browser.usedOnWindows10 to true:

$profile = new FirefoxProfile();
$profile->setPreference('browser.startup.page', 0);
$profile->setPreference('browser.startup.homepage', 'about:blank');
$profile->setPreference('browser.startup.homepage_override.mstone', 'ignore');
$profile->setPreference('browser.usedOnWindows10', true);
$profile->setPreference('xpinstall.signatures.required', false);
Comments