Last active
August 24, 2018 13:06
-
-
Save dhrrgn/c2db3dbcc0ccc7dba500 to your computer and use it in GitHub Desktop.
Setting up Selenium as a Service in OS X
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment