I've found the random port was not working reliably on my home desktop. I didn't have a problem on my laptop strangely. I've solved this elsewhere in the evasion-common get_free_port() which I've adapted and would like to contribute here.
Merge branch 'master' of github.com:eeaston/pkglib
Merge branch 'master' of git://github.com/eeaston/pkglib
Merge branch 'master' of git://github.com/eeaston/pkglib
Merge branch 'master' of git://github.com/eeaston/pkglib
Merge branch 'master' of github.com:oisinmulvihill/pkglib
Merge branch 'master' of git://github.com/eeaston/pkglib
Merge branch 'master' of github.com:oisinmulvihill/pkglib
Merge branch 'master' of git://github.com/eeaston/pkglib
Merge branch 'master' of github.com:oisinmulvihill/pkglib
added the ability to ask for a browser from the SELENIUM_BROWSER env variable.
added the ability to ask for a browser from the SELENIUM_BROWSER env variable.
reverting changes on master while preserving freeport code on its own branch.
Merge pull request #19 from oisinmulvihill/master

selecting the browser to use from SELENIUM_BROWSER env var.