Tests are failing with the latest version of ChromeDriver 75.0.3770.8.
welcome.blade.php template:html
<a href="/click" class="link">Link</a>
/click path:php
Route::get('/click', function () {
return 'clicked';
});
php
public function testBasicExample()
{
$this->browse(function (Browser $browser) {
$browser->visit('/')
->assertSee('Laravel')
->click('.link')
->assertPathIs('/click');
});
}
The test is failing with version 75.0.3770.8 of ChromeDriver and is passing after php artisan dusk:chrome-driver 74.
Chrome version: 75.0.3770.80
OS: Mac
What's the exact error?
Hi @staudenmeir, there is no specific error. The assertPathIs('/click') fails because the browser is not moving to that page. It looks like the bug is related to the trigger of the click action.
I can reproduce it, but this is definitely a Chrome(Driver) bug and not caused by Dusk.
Are there more issues besides clicking on links?
Clicking on buttons is affected too.
It looks like using ChromeDriver 74 is the best workaround at the moment.
I think the issues are caused by ChromeDriver 75 using the W3C mode by default:
https://bugs.chromium.org/p/chromedriver/issues/detail?id=2536
Related discussion in the facebook/php-webdriver repository (which Dusk uses internally):
https://github.com/facebook/php-webdriver/issues/469
Change of the default protocol in Chromedriver 75 was met with a chromedriver bug causing click and other actions to not work, even with W3C protocol disabled.
There is now workaround in https://github.com/facebook/php-webdriver/pull/640 and we hope to get it released ASAP.
Version 1.7.0 of facebook/webdriver has been released and fixes this issue.
Since this will eventually affect everyone, I think we should keep the issue open for a while.
I updated to latest chrome
Session info: headless chrome=75.0.3770.80)
(Driver info: chromedriver=75.0.3770.8 (681f24ea911fe754973dda2fdc6d2a2e159dd300-refs/branch-heads/3770@{#40}),platform=Mac OS X 10.13.4 x86_64)
via mac... I installed laravel dusk 5.1 on Laravel 5.7
noticed that it was only using version 1.3 in the dusk package, so I forced my composer.json to update it to 1.7 for facebook/webdriver...
all I get is a response saying "invalid argument" whenever I try to visit any page... did I miss something?
@SeoRoman Please post the whole error message. Did your test work before?
No, this is brand new installation of Dusk
Dusk: "laravel/dusk": "^5.1",
Laravel: 5.7.33
facebook/webdriver: "facebook/webdriver": "^1.7"
ChromeDriver: 75.0.3770.80
Mac OS X Chrome: 75.0.3770.8
Sample Test
`public function test_auth_login()
{
//$user = factory(User::class)->create();
$this->browse(function (Browser $browser) {
$browser->visit('auth/login')->assertSee('Discord Login');
});
}`
Error Message
Romans-Mac-site roman$ php artisan dusk
PHPUnit 7.5.12 by Sebastian Bergmann and contributors.
E 1 / 1 (100%)
Time: 2.19 seconds, Memory: 12.00 MB
There was 1 error:
1) Tests\Browser\SendInvitationTest::test_auth_login
Facebook\WebDriver\Exception\UnrecognizedExceptionException: invalid argument
(Session info: headless chrome=75.0.3770.80)
(Driver info: chromedriver=75.0.3770.8 (681f24ea911fe754973dda2fdc6d2a2e159dd300-refs/branch-heads/3770@{#40}),platform=Mac OS X 10.13.4 x86_64)
/Library/WebServer/site/vendor/facebook/webdriver/lib/Exception/WebDriverException.php:158
/Library/WebServer/site/vendor/facebook/webdriver/lib/Remote/HttpCommandExecutor.php:333
/Library/WebServer/site/vendor/facebook/webdriver/lib/Remote/RemoteWebDriver.php:561
/Library/WebServer/site/vendor/facebook/webdriver/lib/Remote/RemoteExecuteMethod.php:40
/Library/WebServer/site/vendor/facebook/webdriver/lib/WebDriverNavigation.php:85
/Library/WebServer/site/vendor/laravel/dusk/src/Browser.php:138
/Library/WebServer/site/tests/Browser/SendInvitationTest.php:26
/Library/WebServer/site/vendor/laravel/dusk/src/Concerns/ProvidesBrowser.php:67
/Library/WebServer/site/tests/Browser/SendInvitationTest.php:27
I can confirm the new version of facebook/webdriver is working for me.
I confirmed that I am infact using 1.7 by diving into the source code of facebook/webdriver and finding the HOT FIX for w3c code because I was going to manually copy / paste it from what I saw on their site, but found that it was already there...
@staudenmeir Any thoughts?
omfg.... I don't even want to get started with what my issue was... apparently I have APP_URL=localhost and not APP_URL=http://localhost....
I have literally been struggling with this ALL day
I faced this issue with the version 75 of chromedriver, I fixed it with downgrade to the version 74 !
@staudenmeir @pdavide So updating to a newer version of https://github.com/facebook/php-webdriver/ works? If so feel free to send in a PR to the 5.0 branch to bump the dependency or I'll do it later.
@driesvints I have sent over a pull request that I did test all the way back to laravel/dusk:3, as that was the version we were running up until today.
The PR that bumps the facebook driver has been merged. Will do a new release tomorrow.
No, this is brand new installation of Dusk
Dusk: "laravel/dusk": "^5.1",
Laravel: 5.7.33
facebook/webdriver: "facebook/webdriver": "^1.7"
ChromeDriver: 75.0.3770.80
Mac OS X Chrome: 75.0.3770.8Sample Test
`public function test_auth_login()
{
//$user = factory(User::class)->create();$this->browse(function (Browser $browser) { $browser->visit('auth/login')->assertSee('Discord Login'); }); }`Error Message
Romans-Mac-site roman$ php artisan dusk PHPUnit 7.5.12 by Sebastian Bergmann and contributors. E 1 / 1 (100%) Time: 2.19 seconds, Memory: 12.00 MB There was 1 error: 1) Tests\Browser\SendInvitationTest::test_auth_login Facebook\WebDriver\Exception\UnrecognizedExceptionException: invalid argument (Session info: headless chrome=75.0.3770.80) (Driver info: chromedriver=75.0.3770.8 (681f24ea911fe754973dda2fdc6d2a2e159dd300-refs/branch-heads/3770@{#40}),platform=Mac OS X 10.13.4 x86_64) /Library/WebServer/site/vendor/facebook/webdriver/lib/Exception/WebDriverException.php:158 /Library/WebServer/site/vendor/facebook/webdriver/lib/Remote/HttpCommandExecutor.php:333 /Library/WebServer/site/vendor/facebook/webdriver/lib/Remote/RemoteWebDriver.php:561 /Library/WebServer/site/vendor/facebook/webdriver/lib/Remote/RemoteExecuteMethod.php:40 /Library/WebServer/site/vendor/facebook/webdriver/lib/WebDriverNavigation.php:85 /Library/WebServer/site/vendor/laravel/dusk/src/Browser.php:138 /Library/WebServer/site/tests/Browser/SendInvitationTest.php:26 /Library/WebServer/site/vendor/laravel/dusk/src/Concerns/ProvidesBrowser.php:67 /Library/WebServer/site/tests/Browser/SendInvitationTest.php:27
I am still getting same error
I faced this issue with the version
75ofchromedriver, I fixed it withdowngradeto the version 74 !
I tried first on the chrome version 74 but I get the error and when I upgraded to 75 I am facing the same error
Hi @alpharameeztech !
I don't know your setup, but in my setup (win7/ubuntu in local/prod env) it's work !
Now, in my setup I'm using ChromeDriver 72.0.3626.69 (3c16f8a135abc0d4da2dff33804db79b849a7c38) !
@atefBB I reinstalled the dusk and everything seems to be working :) with chrome 75
No, this is brand new installation of Dusk
Dusk: "laravel/dusk": "^5.1",
Laravel: 5.7.33
facebook/webdriver: "facebook/webdriver": "^1.7"
ChromeDriver: 75.0.3770.80
Mac OS X Chrome: 75.0.3770.8Sample Test
`public function test_auth_login()
{
//$user = factory(User::class)->create();$this->browse(function (Browser $browser) { $browser->visit('auth/login')->assertSee('Discord Login'); }); }`Error Message
Romans-Mac-site roman$ php artisan dusk PHPUnit 7.5.12 by Sebastian Bergmann and contributors. E 1 / 1 (100%) Time: 2.19 seconds, Memory: 12.00 MB There was 1 error: 1) Tests\Browser\SendInvitationTest::test_auth_login Facebook\WebDriver\Exception\UnrecognizedExceptionException: invalid argument (Session info: headless chrome=75.0.3770.80) (Driver info: chromedriver=75.0.3770.8 (681f24ea911fe754973dda2fdc6d2a2e159dd300-refs/branch-heads/3770@{#40}),platform=Mac OS X 10.13.4 x86_64) /Library/WebServer/site/vendor/facebook/webdriver/lib/Exception/WebDriverException.php:158 /Library/WebServer/site/vendor/facebook/webdriver/lib/Remote/HttpCommandExecutor.php:333 /Library/WebServer/site/vendor/facebook/webdriver/lib/Remote/RemoteWebDriver.php:561 /Library/WebServer/site/vendor/facebook/webdriver/lib/Remote/RemoteExecuteMethod.php:40 /Library/WebServer/site/vendor/facebook/webdriver/lib/WebDriverNavigation.php:85 /Library/WebServer/site/vendor/laravel/dusk/src/Browser.php:138 /Library/WebServer/site/tests/Browser/SendInvitationTest.php:26 /Library/WebServer/site/vendor/laravel/dusk/src/Concerns/ProvidesBrowser.php:67 /Library/WebServer/site/tests/Browser/SendInvitationTest.php:27
I have exactly the same issue. though i tried adding APP_URL= "" correctly but still get the same issue. i updated "facebook/webdriver": "^1.7" too but no luck. any solution please? Thanks!
Hey guys, just chipping in here. Have a read though https://w3c.github.io/webdriver/#handling-errors to understand what these error codes mean. It provides information on HTTP status and a description for the error and If you are feeling brave enough drive into the source code where you can debug further.
Most helpful comment
omfg.... I don't even want to get started with what my issue was... apparently I have APP_URL=localhost and not APP_URL=http://localhost....
I have literally been struggling with this ALL day