#!/usr/bin/perl -w0
use Selenium::Chrome;
$|++;
print "PATH: $ENV{PATH}nn";
my $chrome = Selenium::Chrome->new(
browser_name => 'chrome',
extra_capabilities => {
chromeOptions => {
args => [ 'window-size=1920,1080',
'headless',
'no-sandbox',
'disable-dev-shm-usage',
]}});
$chrome->get('http://www.google.com');
It prints $PATH
as follows:
PATH: /root/.local/bin:/root/bin:/home/admin/.local/bin:/home/admin/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/admin/.selenium:/home/admin/.selenium/ChromeDriver
But it can’t proceed with the code due to the following error:
Unable to find the chromedriver binary in your $PATH.
at /usr/local/share/perl5/5.32/Selenium/CanStartBinary/FindBinary.pm line 72.
Selenium server did not return proper status
The google-chrome
binary is in /usr/bin/
:
# /usr/bin/google-chrome --version
Google Chrome 124.0.6367.118
The ChromeDriver
is in /home/admin/.selenium/ChromeDriver/
:
# /home/admin/.selenium/ChromeDriver/chrome --version
Google Chrome for Testing 124.0.6367.155
I have no idea what gets wrong, and why I am experiencing the error
Unable to find the chromedriver binary in your $PATH