Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash -e
- echo https://tecadmin.net/setup-selenium-chromedriver-on-ubuntu/
- export CLASSPATH=".:selenium-server-standalone-3.13.0.jar:testng-6.8.7.jar"
- cmd="xvfb-run --auto-servernum --server-num=1 java -Dwebdriver.chrome.driver=/usr/bin/chromedriver -jar selenium-server-standalone-3.13.0.jar"
- #runs command in the backgorund
- $cmd &
- #waits until server is ready to process requests and returns control
- until curl -sSf http://localhost:4444 > /dev/null 2>&1; do :; done
- javac TecAdminSeleniumTest.java
- java TecAdminSeleniumTest
- sleep 1
- bg_pid=$!
- #terminates a background task by pid
- selenium_pid=$(lsof -i:4444 -t)
- kill $selenium_pid
- wait $bg_pid
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement