Alternative Browser with PHPUnit – Selenium

If you want to start e.g. firefox portable instead of a (fixed installed) firefox with phpunit on a selenium server, this should work like this:

$browser = $this->setBrowser(“*custom c:\\jada jada\FirefoxPortable.exe”);

Unfortunately, this doesn’t work (with selenium-server 2.36 und 2.39 and firefox 24/26)  – on the selenium-server the internet explorer gets started (fallback?). The selenium-server is a server 2003 btw.

What works instead:

$browser = $this->SetBrowser(“firefox”);

this being the normal call to the firefox browser. On the server has to be specified after the java call:

java -jar selenium-server-standalone-2.39.0.jar -Dwebdriver.firefox.bin=”c:\\jada jada\FirefoxPortable.exe”

With this one overwrites which browser the selenium-server associates with the “firefox” expression.

Remark: I wrote down these commands on another machine, there may be typos etc. in there – sorry.