Selenium Server + OS X

Using Selenium Server on OS X can be a pain in the ass.  But have no fear, I have done the hard work for you!

Simply save these two files to the same directory (right-click on 'view raw' and "Save Link as..."), and run the install.sh file from the command line.

When installation is complete, Selenium Server will start, and will be started automatically when you computer starts up.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
#!/usr/bin/env bash
 
if [ ! -d /usr/lib/selenium/ ]; then
sudo mkdir /usr/lib/selenium/
fi
 
if [ ! -f /usr/lib/selenium/selenium-server-standalone-2.41.0.jar ]; then
sudo curl -o /usr/lib/selenium/selenium-server-standalone-2.41.0.jar http://selenium-release.storage.googleapis.com/2.41/selenium-server-standalone-2.41.0.jar
fi
 
 
if [ ! -d /usr/lib/selenium/ ]; then
sudo mkdir -p /var/log/selenium/
fi
 
sudo chmod a+w /var/log/selenium/
 
cp $PWD/selenium.plist ~/Library/LaunchAgents/selenium.plist
launchctl load ~/Library/LaunchAgents/selenium.plist
launchctl start selenium
view raw install.sh hosted with ❤ by GitHub
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>selenium</string>
<key>OnDemand</key>
<true/>
<key>ProgramArguments</key>
<array>
<string>/usr/bin/java</string>
<string>-jar</string>
<string>/usr/lib/selenium/selenium-server-standalone-2.41.0.jar</string>
<string>-port</string>
<string>4443</string>
</array>
<key>ServiceDescription</key>
<string>Selenium Server</string>
<key>StandardErrorPath</key>
<string>/var/log/selenium/selenium-error.log</string>
<key>StandardOutPath</key>
<string>/var/log/selenium/selenium-output.log</string>
</dict>
</plist>
view raw selenium.plist hosted with ❤ by GitHub