Cheng Shi
Cheng Shi

Reputation: 210

Unable to run Laravel Browser Test with Dusk

I am setting up Browser Test with Laravel 5.7. Install Laravel Dusk. My very beginning php artisan dusk command return errors

My Chrome is version 76. Initially, I see "Chrome version must be between 70 and 73". So I download Chrome Driver for my corresponding browser version. Then Run the command again, and I see a new error Facebook\WebDriver\Exception\UnrecognizedExceptionException: invalid argument

I didn't change any code after running initial php artisan dusk:install

Upvotes: 1

Views: 4487

Answers (3)

Neo
Neo

Reputation: 11557

I was having same issue and managed to fix it, luckily I had another latest Laravel installation that had a higher dusk version that was working. The old version would not work with the same version of ChromiumDriver after installing using the php artisan dusk:chrome-driver command. I am not sure why but the version 128 on Laravel 9 is not the same as one from Laravel 10 or more specifically Dusk v7 vs v8. So for me I went in my new laravel version inside:

vendor\laravel\dusk\bin 

-chromedriver-win.exe (is the main file you need)

but you might have a win-32 or win-64 folder that has the file in it too just copy the entire folder, and replaced all those files with one from a newer dusk. (Make sure to get it working first on the latest Laravel first. If it works most likely copy and pasting it to your old version will also works. It did for me so worth the try.

Upvotes: 0

D T
D T

Reputation: 1556

Make sure host and Dusk are using the same Chromium driver:

# linux box
chromium-browser --version

# install specific version on dusk
php artisan dusk:chrome-driver 78

I was running dusk through homebrew and I found that I needed to reload vagrant as well:

vagrant reload --provision

Upvotes: 4

René Höhle
René Höhle

Reputation: 27285

I've found some interesting Issues on Github that should be your problem.

https://github.com/laravel/dusk/issues/651

I think that is a problem with the Driver. Perhaps you can find a solutions and check some of the mentioned problems in that issue to find your problem. It's bit difficult to help you without having the code and having the same problem to test.

Some of them have reinstalled dusk and it was working. So you can test do install the newest driver first and then install the dusk package after that.

Upvotes: 0

Related Questions