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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
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
# Start Selenium server | |
start_selenium | |
# stop Selenium server | |
stop_selenium | |
# Status for Selenium server | |
status_selenium | |
status_selenium -v |
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
# @Author Jobinhood | |
BV_GREEN_TICK='\e[0;32m [✔] \e[0m'; | |
BV_RED_CROSS='\e[0;91m [✗] \e[0m'; | |
BV_YELLOW_DOT='\e[0;33m [.] \e[0m'; | |
BV_YELLOW_DOTS='\e[0;33m ... \e[0m'; | |
# Helper to run sudo commands for us by asking | |
# sudo password if needed | |
sudo_needed() { |
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
# Start Selenium | |
sudo launchctl load /Library/LaunchDaemons/org.seleniumhq.selenium.plist | |
# Stop Selenium | |
sudo launchctl unload /Library/LaunchDaemons/org.seleniumhq.selenium.plist | |
# Is it working? | |
ps -ef | grep selenium | grep java | grep chromedriver | grep -v grep | grep -c selenium | |
# Will show 0 if selenium is not running, and 1 otherwise |
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>org.seleniumhq.selenium</string> | |
<key>UserName</key> | |
<string>_selenium</string> | |
<key>ProgramArguments</key> | |
<array> |
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
# Create plist file in /Library/LaunchDaemons | |
vi /Library/LaunchDaemons/org.seleniumhq.selenium.plist |
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
# 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 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
# Change group ownership to _selenium | |
sudo chown -R _selenium:_selenium /usr/local/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
$ sudo dscl | |
Entering interactive mode… (type “help” for commands) | |
> cd /Local/Default | |
> ls Groups gid | |
... | |
_selenium 703 | |
_sshd 75 | |
_www 70 | |
... |
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
# 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 |
NewerOlder