Created
May 8, 2012 16:00
-
-
Save pettazz/2636657 to your computer and use it in GitHub Desktop.
bash script for starting/stopping selenium server from python 2.7's SeleniumLibrary
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
#!/bin/bash | |
if [ "$1" == 'stop' ]; then | |
echo "Stopping selenium server..." | |
pid=`ps -eo pid,args | grep selenium-server.jar | grep -v grep | cut -c1-6` | |
kill -9 $pid | |
elif [ "$1" == 'start' ]; then | |
echo "Starting selenium server..." | |
cd /Library/Python/2.7/site-packages/SeleniumLibrary/lib/ | |
java -jar selenium-server.jar &> /dev/null & | |
else | |
echo "Nothing to do" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Or just
alias 'kill_selenium'='sudo kill $(lsof -i:5859 | grep localhost:5859 | cut -c9-14)'
works for me to killselenium-standalone
.