Created
March 23, 2022 01:28
-
-
Save wiserfirst/cf576c7b166f4130afed61e39602fac1 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env bash | |
chromedriver_path=$(command -v chromedriver) | |
unameOut="$(uname -s)" | |
case "${unameOut}" in | |
Linux*) chrome_path="/usr/bin/google-chrome";; | |
Darwin*) chrome_path="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome";; | |
esac | |
chromedriver_version=$("${chromedriver_path}" --version) | |
chrome_version=$("${chrome_path}" --version) | |
chromedriver_major_version=$("${chromedriver_path}" --version | cut -f 2 -d " " | cut -f 1 -d ".") | |
chrome_major_version=$("${chrome_path}" --version | cut -f 3 -d " " | cut -f 1 -d ".") | |
if [ "${chromedriver_major_version}" == "${chrome_major_version}" ]; then | |
echo "Chromedriver matches chrome version ✓" | |
exit 0 | |
else | |
echo "Wallaby often fails with 'invalid session id' if Chromedriver and Chrome have different versions." | |
echo "Chromedriver version: ${chromedriver_version} (${chromedriver_path})" | |
echo "Chrome version : ${chrome_version} (${chrome_path})" | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment