rhand
5 days ago
282
8
Laravel

Laravel Dusk Unable to locate element: ...":"body textarea[name='email']"}

Posted 5 days ago by rhand

Tried a test that I ran succesfully before

valet @ MacMini [jasper] $ php artisan dusk tests/Browser/ExampleTest.php 
PHPUnit 7.5.14 by Sebastian Bergmann and contributors.

E                                                                   1 / 1 (100%)

Time: 4.72 seconds, Memory: 28.00 MB

There was 1 error:

1) Tests\Browser\ExampleTest::testBasicExample
Facebook\WebDriver\Exception\NoSuchElementException: no such element: Unable to locate element: {"method":"css selector","selector":"body textarea[name='email']"}
  (Session info: headless chrome=76.0.3809.132)
  (Driver info: chromedriver=76.0.3809.126 (d80a294506b4c9d18015e755cee48f953ddc3f2f-refs/branch-heads/[email protected]{#1024}),platform=Mac OS X 10.14.6 x86_64)

/Users/jasper/code/site.com/valet/vendor/facebook/webdriver/lib/Exception/WebDriverException.php:102
/Users/jasper/code/site.com/valet/vendor/facebook/webdriver/lib/Remote/HttpCommandExecutor.php:331
/Users/jasper/code/site.com/valet/vendor/facebook/webdriver/lib/Remote/RemoteWebDriver.php:565
/Users/jasper/code/site.com/valet/vendor/facebook/webdriver/lib/Remote/RemoteWebDriver.php:204
/Users/jasper/code/site.com/valet/vendor/laravel/dusk/src/ElementResolver.php:362
/Users/jasper/code/site.com/valet/vendor/laravel/dusk/src/ElementResolver.php:340
/Users/jasper/code/site.com/valet/vendor/laravel/dusk/src/ElementResolver.php:89
/Users/jasper/code/site.com/valet/vendor/laravel/dusk/src/Concerns/InteractsWithElements.php:142
/Users/jasper/code/site.com/valet/tests/Browser/ExampleTest.php:27
/Users/jasper/code/site.com/valet/vendor/laravel/dusk/src/Concerns/ProvidesBrowser.php:67
/Users/jasper/code/site.com/valet/tests/Browser/ExampleTest.php:33

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

Thought perhaps I need to install things for Dusk once more on the new branch and then I had this error:

php artisan dusk:install
Dusk scaffolding installed successfully.
Downloading ChromeDriver binaries...

   ErrorException  : Undefined offset: 1

  at /Users/jasper/code/site.com/valet/vendor/laravel/dusk/src/Console/ChromeDriverCommand.php:172
    168|         $home = $this->getUrl($this->homeUrl);
    169| 
    170|         preg_match('/Latest stable release:.*?\?path=([\d.]+)/', $home, $matches);
    171| 
  > 172|         return $matches[1];
    173|     }
    174| 
    175|     /**
    176|      * Download the ChromeDriver archive.

Not sure if ErrorException : Undefined offset: 1 was a real issue or whether I needed Dusk again in the first place but the error Unable to locate element: {"method":"css selector","selector":"body textarea[name='email']"}

Any ideas?

Please sign in or create an account to participate in this conversation.