Dusk: Basic Install Chromedriver Does Not Start (Windows)

Created on 26 Jan 2017  路  18Comments  路  Source: laravel/dusk

Did a fresh install of laravel and the ran composer require laravel/dusk, following the scaffolding and the chrome driver doesn't work. Am I supposed to be running something outside of running the tests that is meant for dusk to connect to?

`
$ ./vendor/bin/phpunit -c phpunit.dusk.xml
PHPUnit 5.7.7 by Sebastian Bergmann and contributors.

E                                                                  1 / 1 (100%)

Time: 9.41 seconds, Memory: 8.00MB

There was 1 error:

1) Tests\Browser\ExampleTest::testBasicExample
Facebook\WebDriver\Exception\WebDriverCurlException: Curl error thrown for http POST to /session     with params: {"desiredCapabilities":{"browserName":"chrome","platform":"ANY"}}

Failed to connect to localhost port 9515: Connection refused

(app_path)\vendor\facebook\webdriver\lib\Remote\HttpCommandExecutor.php:287
(app_path)\vendor\facebook\webdriver\lib\Remote\RemoteWebDriver.php:121
(app_path)\tests\DuskTestCase.php:32
(app_path)\vendor\laravel\dusk\src\TestCase.php:180
(app_path)\vendor\laravel\framework\src\Illuminate\Support\helpers.php:639
(app_path)\vendor\laravel\dusk\src\TestCase.php:181
(app_path)\vendor\laravel\dusk\src\TestCase.php:111
(app_path)\vendor\laravel\dusk\src\TestCase.php:85
(app_path)\tests\Browser\ExampleTest.php:21

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

`

Most helpful comment

This appears to still be an issue.

All 18 comments

Also from within a vagrant box running debian I get what looks like a shell script,

`
vagrant@debian:/srv/web$ php artisan dusk

dir=$(d=${0%[/\\]*}; cd "$d"; cd '../phpunit/phpunit' && pwd)

# See if we are running in Cygwin by checking for cygpath program
if command -v 'cygpath' >/dev/null 2>&1; then
        # Cygwin paths start with /cygdrive/ which will break windows PHP,
        # so we need to translate the dir path to windows format. However
        # we could be using cygwin PHP which does not require this, so we
        # test if the path to PHP starts with /cygdrive/ rather than /usr/bin
        if [[ $(which php) == /cygdrive/* ]]; then
                dir=$(cygpath -m "$dir");
        fi
fi

dir=$(echo $dir | sed 's/ /\ /g')
"${dir}/phpunit" "$@"

`

It does work on Mac though, but doesn't work when it's running in vagrant.

It cannot work in vagrant box (based on Windows 10) too. I've got the same error with @Sieabah.

@Sieabah @vuongggggg Try dev-master branch for this (PR with fix was already merged)

@mnabialek Nice! Thank you so much. It's work.

@Sieabah Try dev-master branch in the composer. In vagrant, you need to change localhost to 10.0.2.2 in DuskTestCase.php (function driver). Hope it will help you.

I had the same problem and this thread solved it for me. Thanks!

My pc runs Windows 10, with the Homestead Vagrant box.
With dusk on dev-master, I tried to connect to 10.0.2.2 and that works, provided ChromeDriver is running in Windows and the correct APP_URL is in the .env file.

I got Dusk working with the solutions mentioned above on Windows 7 and Homestead Vagrant. It does however take upwards of 20+ seconds to execute the default tests included. Does anyone know how to speed this up?

I'll get to testing this tomorrow.

Can this be closed?

I try with dev-master and don't work for me, still getting connection refused

@nonDeath Are you running Cent OS? Ubuntu? Windows? Don't run with root user. Check out #98 and #71

I running over ubuntu, apache2 and php7. But i see that issues and ... I do not want to blow away.

Trying execute the code inside SupportsChrome trait on tinker and i get null when start the process. May be smoething is wrong (permissions, locations etc etc)

@deleugpn i work around on this work with phantomjs.

And ... in the past year i work with the facebok web driver but with selenium and it work fine!

@deleugpn it's work!

Using phantomjs, but running it on another terminal.

$ phantomjs --webdriver=172.0.0.1:9515

and then

$ php artisan dusk

And it works fine. But, and it is a great but....

After this work for me, phantomjs thrown an error and I look for this githubgist https://gist.github.com/flamingbear/10506888

And the port 9515 (DuskTestCase default port) ever is taken by the crhomedriver, i don't know why...

But killing its process, its works, unfortunately i'm killing it after each dusk running... not all was a great solution, but it work for me.

Changing the port for another unused, by example 4444... i get green in each test running.

This workaround i take from a friend and looking in this work https://twitter.com/laravelphp/status/826534379551936514

I got the same problem and found out what the problem on my side was: I had (running Win7) two local environment variables installed:
http_proxy and https_proxy pointing to 127.0.0.1:3128. I need them for composer and the corporate proxy. After removing it (temporarely), it works.

This appears to still be an issue.

how to start chromedriver manually on linux?

Closing this issue because it's already solved, old or not relevant anymore. Feel free to reply if you're still experiencing this issue.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ahtinurme picture ahtinurme  路  6Comments

rauldeheer picture rauldeheer  路  4Comments

marcusmoore picture marcusmoore  路  3Comments

antonioribeiro picture antonioribeiro  路  5Comments

digitlimit picture digitlimit  路  4Comments