Skip to content

Instantly share code, notes, and snippets.

@willycedric
Created November 13, 2020 17:02
Show Gist options
  • Save willycedric/c0047e1be0b5db42b2066e176739100e to your computer and use it in GitHub Desktop.
Save willycedric/c0047e1be0b5db42b2066e176739100e to your computer and use it in GitHub Desktop.
Selenium grid status (prior to v4)
#!/usr/bin/env bash
# check-grid.sh
set -e
HOST="localhost"
PORT="4444"
echoerr() { echo "$@" 1>&2; }
# process arguments
while [[ $# -gt 0 ]]
do
case "$1" in
--host)
HOST=${2:-"localhost"}
shift 2
;;
--port)
PORT=${2:-"4444"}
shift 2
;;
*)
echoerr "Unknown argument: $1"
exit 1
;;
esac
done
curl -sSL http://${HOST}:${PORT}/wd/hub/status | jq -r '.value.ready' | grep "true" || exit 1
@willycedric
Copy link
Author

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment