简体   繁体   中英

Laravel Dusk: unknown error: call function result missing 'value'

I'm having problems with the Laravel Dusk type() and value() method. I'm getting the following error.

$ php artisan dusk --group=activation
Warning: TTY mode is not supported on Windows platform.
PHPUnit 5.7.27 by Sebastian Bergmann and contributors.


DevTools listening on ws://127.0.0.1:12599/devtools/browser/84028821-2ca1-4d26-b66c-4697d2302117
E                                                                   1 / 1 (100%)

Time: 13,35 seconds, Memory: 18,00MB

There was 1 error:

1) Tests\Browser\CounselorActivationTest::testActivationWithSubscriptionWithPasswordLogin
Facebook\WebDriver\Exception\UnknownServerException: unknown error: call function result missing 'value'
  (Session info: chrome=68.0.3440.84)
  (Driver info: chromedriver=2.33.506120 (e3e53437346286c0bc2d2dc9aa4915ba81d9023f),platform=Windows NT 10.0.17134 x86_64)

D:\devYubu\yubu\vendor\facebook\webdriver\lib\Exception\WebDriverException.php:114
D:\devYubu\yubu\vendor\facebook\webdriver\lib\Remote\HttpCommandExecutor.php:326
D:\devYubu\yubu\vendor\facebook\webdriver\lib\Remote\RemoteWebDriver.php:547
D:\devYubu\yubu\vendor\facebook\webdriver\lib\Remote\RemoteWebDriver.php:308
D:\devYubu\yubu\vendor\laravel\dusk\src\Concerns\InteractsWithElements.php:97
D:\devYubu\yubu\tests\Browser\tests\userActivation\CounselorActivationTest.php:58
D:\devYubu\yubu\vendor\laravel\dusk\src\TestCase.php:91
D:\devYubu\yubu\tests\Browser\tests\userActivation\CounselorActivationTest.php:95

ERRORS!
Tests: 1, Assertions: 0, Errors: 1.

I'm using the value method 2 times, I can see that the first one actually fills in the form, however the second one fails..

->value('input[name=external_id]', $counselor->getAttribute(User::COLUMN_EXTERNAL_ID))
->value('input[name=name_full]', $counselor->getAttribute(User::COLUMN_NAME_FULL))

When I'm using type(), the first one also fails:

->type('external_id', $counselor->getAttribute(User::COLUMN_EXTERNAL_ID))
->type('name_full', $counselor->getAttribute(User::COLUMN_NAME_FULL))

In using Windows 10. I'm running Dusk on Windows (I have PHP 7.2 installed). My application runs on Homestead with PHP 7.0. I'm using Laravel 5.4

This was a problem with an outdated ChromeDriver.

Big thanks to Jonas Staudenmeir, who has created a package for updating your Chromedriver:

https://github.com/staudenmeir/dusk-updater

I echo @Martijn Ihhoff. Get the staudenmeir updater - https://github.com/staudenmeir/dusk-updater

After you download and run it (follow instructions on linked page above) be sure to kill the old ChromeDriver though. Here's how I did it:

run ps -aux then find the process ending with /vendor/laravel/dusk/bin/chromedriver-linux the second parameter from the left on that line will be the PID (Process ID) copy it (and any other PID's of running chromeDrivers) and then kill each of them by running kill ##### where ##### is the copied PID. Once all processes are killed, re-run dusk.

I had the same problem. https://github.com/staudenmeir/dusk-updater Script saved my day. Thanks to the writer.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM