Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Basic Install Chromedriver Does Not Start (Windows) #55

Closed
Sieabah opened this issue Jan 26, 2017 · 18 comments
Closed

Basic Install Chromedriver Does Not Start (Windows) #55

Sieabah opened this issue Jan 26, 2017 · 18 comments

Comments

@Sieabah
Copy link

Sieabah commented Jan 26, 2017

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.

`

@Sieabah
Copy link
Author

Sieabah commented Jan 26, 2017

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" "$@"

`

@Sieabah
Copy link
Author

Sieabah commented Jan 27, 2017

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

@vuon9
Copy link

vuon9 commented Jan 29, 2017

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

@mnabialek
Copy link
Contributor

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

@vuon9
Copy link

vuon9 commented Jan 30, 2017

@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.

@mrCartmenez
Copy link

mrCartmenez commented Jan 30, 2017

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.

@denisrpriebe
Copy link

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?

@Sieabah
Copy link
Author

Sieabah commented Feb 4, 2017

I'll get to testing this tomorrow.

@deleugpn
Copy link
Contributor

Can this be closed?

@nonDeath
Copy link

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

@deleugpn
Copy link
Contributor

deleugpn commented Mar 15, 2017

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

@nonDeath
Copy link

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)

@nonDeath
Copy link

@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!

@nonDeath
Copy link

@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

@pr4xx
Copy link

pr4xx commented Jul 28, 2017

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.

@BioTurboNick
Copy link

This appears to still be an issue.

@jvillaruel
Copy link

how to start chromedriver manually on linux?

@driesvints
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests