Installing Google Chrome For Testing and Chromedriver on Ubuntu Linux
Linux
2024-06-13 03:09 (21 months ago)
Here is a note on how to install Google Chrome For Testing 126 and chromedriver 126 on Ubuntu 22.
Supplemental Information
Generally, it's easier and recommended to use Docker's Standalone Chrome (Selenium Grid) instead of following these steps.
https://hub.docker.com/r/selenium/standalone-chrome/tags
However, in environments where Docker cannot be used or in cases where there are special requirements for file downloads, these steps might not work as expected.
Steps
If google-chrome-stable is installed via apt, uninstall it.
dpkg --get-selections | grep google-chrome-stable
sudo dpkg --purge google-chrome-stable
Verify the release status of Chrome for Testing
Check the following page:
https://googlechromelabs.github.io/chrome-for-testing/
Download
On Linux:
cd /tmp
curl -O "https://storage.googleapis.com/chrome-for-testing-public/126.0.6478.55/linux64/chrome-linux64.zip"
curl -O "https://storage.googleapis.com/chrome-for-testing-public/126.0.6478.55/linux64/chromedriver-linux64.zip"
Extract
unzip chrome-linux64.zip
unzip chromedriver-linux64.zip
No need for the -d option.
Move
sudo mv /tmp/chromedriver-linux64/chromedriver /usr/local/bin/
sudo mv /tmp/chrome-linux64 /usr/local/bin/
sudo ln -s /usr/local/bin/chrome-linux64/chrome /usr/local/bin/google-chrome
Verify Chrome Operation
cd /tmp
google-chrome --headless --disable-gpu --screenshot https://www.example.com/
imgcat screenshot.png
Verify chromedriver Operation
chromedriver --verbose & curl -d '{ "desiredCapabilities": {"browserName": "chrome", "chromeOptions": {"args": [ "--headless" ]} }}' http://127.0.0.1:9515/session
Result
Starting ChromeDriver 126.0.6478.55 (7616ff175414646cbd1ac65e912fc530b19cc573-refs/branch-heads/6478@{#1402}) on port 9515
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.
{"sessionId":"463314578b16e8b2d57efc572a6fa6b8","status":0,"value":{"acceptInsecureCerts":false,"acceptSslCerts":false,"browserConnectionEnabled":false,"browserName":"chrome-headless-shell","chrome":{"chromedriverVersion":"126.0.6478.55 (7616ff175414646cbd1ac65e912fc530b19cc573-refs/branch-heads/6478@{#1402})","userDataDir":"/tmp/.org.chromium.Chromium.RjvIex"},"cssSelectorsEnabled":true,"databaseEnabled":false,"fedcm:accounts":true,"goog:chromeOptions":{"debuggerAddress":"localhost:34017"},"handlesAlerts":true,"hasTouchScreen":false,"javascriptEnabled":true,"locationContextEnabled":true,"mobileEmulationEnabled":false,"nativeEvents":true,"networkConnectionEnabled":false,"pageLoadStrategy":"normal","platform":"Linux","proxy":{},"rotatable":false,"setWindowRect":true,"strictFileInteractability":false,"takesHeapSnapshot":true,"takesScreenshot":true,"timeouts":{"implicit":0,"pageLoad":300000,"script":30000},"unexpectedAlertBehaviour":"ignore","version":"126.0.6478.55","webStorageEnabled":true,"webauthn:extension:credBlob":true,"webauthn:extension:largeBlob":true,"webauthn:extension:minPinLength":true,"webauthn:extension:prf":true,"webauthn:virtualAuthenticators":true}}
Please rate this article
Currently unrated
The author runs the application development company Cyberneura.
We look forward to discussing your development needs.
We look forward to discussing your development needs.