Setting up selenium server as a service in os x that starts on boot. What is needed is a plist service file to start and take stdout and stderr and log the output. I will be using homebrew for install of the selenium server. in this example i have used a vagrant image of Yosemite you can find it here vagrant image.
A NOTE about the OS X Licensing. Apple’s EULA states that you can install your copy on your actual Apple-hardware, plus up to two VMs running on your Apple-hardware. So using this box on another hardware is may be illigal and you should do it on your own risk.
Start by installing the selenium standalone server using brew
install java7 using brew cask
create a plist file for the service. This is what is needed if you like to start selenium-standalone with port 4444 and logging the stdout to
/var/log/selenium/selenium-output.log and stderr to
/var/log/selenium/selenium-error.log . save it as selenium.plist
create the log folder using sudo since root will run the service
copy the selenium.plist to
/Library/LaunchDaemons since we like it to run as a demon by the root user on boot.
load the service in to system using
bash script to install google chrome
To make it possible to start running selenium tests on the server you need the user logged with a active workspace. To get this working after reboot with no manual login you do the following. Open
System Preferences >
Security & Privacy >
Click the lock to make changes > uncheck
Disable automatic login .
Source selenium.plist chrome-install.sh