This file contains 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
# Returns 1 if java installed, 0 otherwise | |
which java | grep -c java |
This file contains 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
# Create folders | |
sudo mkdir -p /usr/local/selenium/bin /usr/local/selenium/drivers | |
# Donwload latest selenium server .jar file | |
cd /usr/local/selenium/bin | |
wget http://selenium-release.storage.googleapis.com/3.8/selenium-server-standalone-3.8.1.jar | |
# Download latest chromedriver | |
cd /usr/local/selenium/drivers | |
wget https://chromedriver.storage.googleapis.com/2.35/chromedriver_mac64.zip |
This file contains 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
# Show the last 15 group id created | |
dscacheutil -q group | grep gid | awk ‘{print $2}’ | sort -n | tail -n 5 |
This file contains 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
# Make sure user _selenium does not already exist | |
sudo dscl . -read /Users/_selenium |
This file contains 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
# Create group _selenium with gid 703 | |
sudo dscl . -create /Groups/_selenium | |
sudo dscl . -create /Groups/_selenium PrimaryGroupID 703 | |
# Make sure it now exists | |
dscacheutil -q group | grep gid | awk ‘{print $2}’ | sort -n | tail -n 1 | |
# Create the deamon user _selenium | |
sudo dscl . -create /Users/_selenium UniqueID 703 | |
sudo dscl . -create /Users/_selenium PrimaryGroupID 703 |
This file contains 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
$ sudo dscl | |
Entering interactive mode… (type “help” for commands) | |
> cd /Local/Default | |
> ls Groups gid | |
... | |
_selenium 703 | |
_sshd 75 | |
_www 70 | |
... |
This file contains 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
# Change group ownership to _selenium | |
sudo chown -R _selenium:_selenium /usr/local/selenium |
This file contains 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
# Start Selenium | |
java -Dwebdriver.chrome.driver=/usr/local/selenium/drivers/chromedriver -jar /usr/local/selenium/bin/selenium-server-standalone-3.8.1.jar | |
# Make sure it works | |
ps -ef | grep selenium | grep -v grep |
This file contains 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
# Create plist file in /Library/LaunchDaemons | |
vi /Library/LaunchDaemons/org.seleniumhq.selenium.plist |
This file contains 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>org.seleniumhq.selenium</string> | |
<key>UserName</key> | |
<string>_selenium</string> | |
<key>ProgramArguments</key> | |
<array> |