{"id":706,"date":"2020-10-01T17:25:38","date_gmt":"2020-10-01T11:25:38","guid":{"rendered":"https:\/\/mellowhost.com\/blog\/?p=706"},"modified":"2020-10-01T17:25:38","modified_gmt":"2020-10-01T11:25:38","slug":"how-to-fix-facebookwebdriverexceptionunknownerrorexception-unknown-error-cannot-find-chrome-binary-laravel-dusk","status":"publish","type":"post","link":"https:\/\/mellowhost.com\/blog\/how-to-fix-facebookwebdriverexceptionunknownerrorexception-unknown-error-cannot-find-chrome-binary-laravel-dusk.html","title":{"rendered":"How to Fix: Facebook\\WebDriver\\Exception\\UnknownErrorException: unknown error: cannot find Chrome binary &#8211; Laravel Dusk"},"content":{"rendered":"\n<p>When run the following command in your Laravel Automation Tool Dusk:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">php artisan dusk<\/pre>\n\n\n\n<p>You get something like the following error:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">[elastic-keldysh@pl1 blog]$ php artisan dusk\nPHPUnit 9.3.11 by Sebastian Bergmann and contributors.\n\nE                                                                   1 \/ 1 (100%)\n\nTime: 00:00.339, Memory: 18.00 MB\n\nThere was 1 error:\n\n1) Tests\\Browser\\ExampleTest::testBasicExample\nFacebook\\WebDriver\\Exception\\UnknownErrorException: unknown error: cannot find Chrome binary\n\n\/var\/www\/vhosts\/elastic-keldysh.139-99-24-82.plesk.page\/blog\/vendor\/php-webdriver\/webdriver\/lib\/Exception\/WebDriverException.php:139\n\/var\/www\/vhosts\/elastic-keldysh.139-99-24-82.plesk.page\/blog\/vendor\/php-webdriver\/webdriver\/lib\/Remote\/HttpCommandExecutor.php:370\n\/var\/www\/vhosts\/elastic-keldysh.139-99-24-82.plesk.page\/blog\/vendor\/php-webdriver\/webdriver\/lib\/Remote\/RemoteWebDriver.php:136\n\/var\/www\/vhosts\/elastic-keldysh.139-99-24-82.plesk.page\/blog\/tests\/DuskTestCase.php:40\n\/var\/www\/vhosts\/elastic-keldysh.139-99-24-82.plesk.page\/blog\/vendor\/laravel\/dusk\/src\/Concerns\/ProvidesBrowser.php:200\n\/var\/www\/vhosts\/elastic-keldysh.139-99-24-82.plesk.page\/blog\/vendor\/laravel\/framework\/src\/Illuminate\/Support\/helpers.php:234\n\/var\/www\/vhosts\/elastic-keldysh.139-99-24-82.plesk.page\/blog\/vendor\/laravel\/dusk\/src\/Concerns\/ProvidesBrowser.php:201\n\/var\/www\/vhosts\/elastic-keldysh.139-99-24-82.plesk.page\/blog\/vendor\/laravel\/dusk\/src\/Concerns\/ProvidesBrowser.php:95\n\/var\/www\/vhosts\/elastic-keldysh.139-99-24-82.plesk.page\/blog\/vendor\/laravel\/dusk\/src\/Concerns\/ProvidesBrowser.php:65\n\/var\/www\/vhosts\/elastic-keldysh.139-99-24-82.plesk.page\/blog\/tests\/Browser\/ExampleTest.php:21\n\nERRORS!\nTests: 1, Assertions: 0, Errors: 1.\n<\/pre>\n\n\n\n<p>The error actually appears because you do not have Chrome browser installed on your system. Now, exit from your user shell, and drop back to the root shell. From the root shell, if you are using CentOS 7, you may run the following:<\/p>\n\n\n\n<p>First Download the Latest Chrome RPM:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">wget https:\/\/dl.google.com\/linux\/direct\/google-chrome-stable_current_x86_64.rpm<\/pre>\n\n\n\n<p>Run it with YUM:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">yum install .\/google-chrome-stable_current_*.rpm<\/pre>\n\n\n\n<p>If you are on CentOS 8, you may use dnf installer as following:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">dnf localinstall google-chrome-stable_current_x86_64.rpm<\/pre>\n\n\n\n<p>Once the installation is done, you may now go back to the user shell and run laravel dusk:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">[root@pl1 lib64]# su - elastic-keldysh\nLast login: Thu Oct  1 15:39:18 IST 2020 on pts\/0\n[elastic-keldysh@pl1 ~]$ php artisan dusk\nCould not open input file: artisan\n[elastic-keldysh@pl1 ~]$ cd blog\n[elastic-keldysh@pl1 blog]$ php artisan dusk\nPHPUnit 9.3.11 by Sebastian Bergmann and contributors.\n\nR                                                                   1 \/ 1 (100%)\n\nTime: 00:02.367, Memory: 18.00 MB\n\nThere was 1 risky test:\n\n1) Tests\\Browser\\ExampleTest::testBasicExample\nThis test did not perform any assertions\n\n\/var\/www\/vhosts\/elastic-keldysh.139-99-24-82.plesk.page\/blog\/tests\/Browser\/ExampleTest.php:16\n\nOK, but incomplete, skipped, or risky tests!\nTests: 1, Assertions: 0, Risky: 1.\n<\/pre>\n\n\n\n<p>It shall work now. Hope this helps.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When run the following command in your Laravel Automation Tool Dusk: You get something like the following error: The error actually appears because you do not have Chrome browser installed on your system. Now, exit from your user shell, and drop back to the root shell. From the root shell, if you are using CentOS &hellip; <a href=\"https:\/\/mellowhost.com\/blog\/how-to-fix-facebookwebdriverexceptionunknownerrorexception-unknown-error-cannot-find-chrome-binary-laravel-dusk.html\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;How to Fix: Facebook\\WebDriver\\Exception\\UnknownErrorException: unknown error: cannot find Chrome binary &#8211; Laravel Dusk&#8221;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[318,144,272,273,150],"tags":[520,521,517],"_links":{"self":[{"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/posts\/706"}],"collection":[{"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/comments?post=706"}],"version-history":[{"count":1,"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/posts\/706\/revisions"}],"predecessor-version":[{"id":707,"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/posts\/706\/revisions\/707"}],"wp:attachment":[{"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/media?parent=706"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/categories?post=706"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mellowhost.com\/blog\/wp-json\/wp\/v2\/tags?post=706"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}