Laravel Dusk is a fantastic browser based framework based on Selenium. Dusk relies on Google’s Chrome driver, which updates a lot. With all this updating nonsense you end up in a situation where problems arise. Although Laravel already has this command:
✗ php artisan dusk:chrome-driver ChromeDriver binary successfully installed for version 96.0.4664.45.
In many situations that’s not good enough to get it working, especially if you’re using a Linux Desktop.
The above command sorted out the error below, but unfortunately didn’t make it work:
There was 1 error: 1) Tests\Browser\aRegisterAndAddPropertyTest::test_can_an_estate_agent_register Facebook\WebDriver\Exception\SessionNotCreatedException: session not created: Chrome version must be between 70 and 73 (Driver info: chromedriver=2.45.615279 (12b89733300bd268cff3b78fc76cb8f3a7cc44e5),platform=Linux 5.4.0-90-generic x86_64)
To get it working, additional trickery has to be applied. The new error is below:
There was 1 error: 1) Tests\Browser\aRegisterAndAddPropertyTest::test_can_an_estate_agent_register Facebook\WebDriver\Exception\SessionNotCreatedException: session not created: This version of ChromeDriver only supports Chrome version 96 Current browser version is 94.0.4606.81 with binary path /usr/bin/google-chrome
As you can see from the error above, apparently there is another issue now with /usr/bin/google-chrome
A quick Help / About Google Chrome in the UI shows this version:
Version 94.0.4606.81 (Official Build) (64-bit)
Aha. So it seems that php artisan dusk:chrome-driver
updated the Chrome driver but since Chrome is still outdated there is this issue.
Solution
art dusk:chrome-driver --detect