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

Update Chrome driver to support browser v74 #641

Closed
markdwhite opened this issue Apr 24, 2019 · 100 comments · Fixed by #643
Closed

Update Chrome driver to support browser v74 #641

markdwhite opened this issue Apr 24, 2019 · 100 comments · Fixed by #643

Comments

@markdwhite
Copy link

  • Dusk Version: 5.0.3
  • Laravel Version: 5.8.14
  • PHP Version: 7.2.17
  • Database Driver & Version: mySQL 5.7.25

Description:

Chrome 74 is now available. The current driver has not been updated for 4 months and supports Chrome 70-73 only.

(Driver info: chromedriver=2.45.615279 (12b89733300bd268cff3b78fc76cb8f3a7cc44e5),platform=Linux 4.15.0-47-generic x86_64)
Facebook\WebDriver\Exception\SessionNotCreatedException: session not created: Chrome version must be between 70 and 73

However...chromedriver 74.X does not explicitly support older versions:
https://chromedriver.storage.googleapis.com/74.0.3729.6/notes.txt

Compared to 2.45.X which clearly supports a range of versions 70-73 (and 2.46) but not 74:
https://chromedriver.storage.googleapis.com/2.45/notes.txt
https://chromedriver.storage.googleapis.com/2.46/notes.txt

Does this mean we have to wait for a version that has a more encompassing support so we don't lose backwards compatibility? So we're either pinning Chrome to 73 or using a standalone driver rather than the packaged driver?

Cheers.

@markdwhite markdwhite changed the title Update Chrome driver to support vrowser v74 Update Chrome driver to support browser v74 Apr 24, 2019
@ghost
Copy link

ghost commented Apr 24, 2019

I'm facing the exact same issue.

@ahtinurme
Copy link

Same here.

@tentus
Copy link

tentus commented Apr 24, 2019

Same.

@rmeira
Copy link

rmeira commented Apr 24, 2019

same issue.

@staudenmeir
Copy link
Contributor

In the meantime, you can use my updater package: https://github.com/staudenmeir/dusk-updater

@markdwhite
Copy link
Author

In the meantime, you can use my updater package: https://github.com/staudenmeir/dusk-updater

The reply is appreciated and hopefully it will help some as copying the 74.X chromedriver executable into laravel/dusk/bin will work for local dev. However it doesn't work for CI and an update to the package will be needed at some point. Which may well not happened until a 2.47 chromedriver is released that covers a few versions of Chrome.

@staudenmeir
Copy link
Contributor

The ChromeDriver release strategy has changed and it looks like there will be no more releases that support multiple versions of Chrome: http://chromedriver.chromium.org/downloads/version-selection

Why doesn't the updater work for CI?

@markdwhite
Copy link
Author

markdwhite commented Apr 25, 2019

The ChromeDriver release strategy has changed and it looks like there will be no more releases that support multiple versions of Chrome

That does look like it's the case. I'd looked at that and hoped/expected that something like 2.47 might support a range of browsers when it's released, but it does look like new drivers have only been built to support specific versions and maybe a 2.47 is not in the works.

Which would suggest that this package will become awkward to use in it's current state: I don't mind using the current version of a browser (though it's caught me out this time, and I think it caught me out before too - maybe I should learn from this :) but having to use the current version because Dusk can only support one version at a time in the future might not be ideal for everyone.

Because of that, there may be a need to provide a number of chromedrivers in the package with an option to use any of them.

It looks like the simplest solution for now is to make the correct version of the chromedriver available somewhere in your code repo and adding to DuskTestCase::prepare():

static::useChromedriver(realpath(__DIR__ . '/../bin/chromedriver'));

Why doesn't the updater work for CI?

Fair enough - it will work by running the command on the CI server after the Dusk package is updated. Which is either a manual step or a change to the build file to do this as part of the build process. My first comment reflected that I prefer not to make changes to the contents of /vendor as these cannot be reflected in the project's repo where there are alternatives that can be contained within the project code. But I can see that it would work.

However, I'll just go with manually setting which chromedriver to use until we get a solution from the maintainers of the repo. 'Cause using work-arounds to make up for issues in packages generally suck and get piddly to maintain. And others with the issue can chose which solution works best for them as this is all libre here :)

So some official comment on what's likely to happen here would be really appreciated

@markdwhite
Copy link
Author

I just closed this by mistake...

@markdwhite markdwhite reopened this Apr 25, 2019
@flexnst
Copy link

flexnst commented Apr 25, 2019

same issue.

@driesvints
Copy link
Member

Please use the package from staudenmeier until we update the driver.

@peterfox
Copy link

Ran into this problem this morning. I can't see many options other than no longer storing the chrome driver in the package and adding a command to check for the version of chrome, downloading the right version before running dusk for the first time and keeping it under the vendor folder outside of source control. At 5mb it's not too bad to keep it in the package but if there will be a new driver for each major chrome release it might become a bit excessive to have multiple copies in the repo.

TemaSM added a commit to TemaSM/laravel-vue-spa that referenced this issue Apr 25, 2019
Using package https://github.com/staudenmeir/dusk-updater
See laravel/dusk#641
This commit will probably fix Travis CI failing, because Travis installs latest stable Chrome which not in sync with Chrome driver shipped with Laravel Dusk
@krb19xx
Copy link

krb19xx commented Apr 26, 2019

Same problem...

@bobo52310
Copy link

Same issue.

@driesvints
Copy link
Member

The new dusk:chrome-driver command has now been released.

@Tarasovych
Copy link

Tarasovych commented May 4, 2019

I have tried

php artisan dusk:chrome-driver 73

and

php artisan dusk

Anyway I got

Facebook\WebDriver\Exception\UnknownServerException: unknown error: cannot find Chrome binary
(Driver info: chromedriver=72.0.3626.69 (3c16f8a135abc0d4da2dff33804db79b849a7c38),platform=Linux 4.15.0-47-generic x86_64)

What should I do more?

P. S.

./vendor/laravel/dusk/bin/chromedriver-linux

returns

Starting ChromeDriver 73.0.3683.68 (47787ec04b6e38e22703e856e101e840b65afe72) on port 9515
Only local connections are allowed.
Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.

@staudenmeir
Copy link
Contributor

@Tarasovych Please try terminating all running ChromeDriver processes.

@Tarasovych
Copy link

@staudenmeir that's strange, but:

ps -aux | grep chrome

returns a new one process each time, so after I found its PID and go

kill <PID>

, it just outputs

No such process

I'm working in Homestead, tried

php artisan reload --provision

and relogin into VM, didn't helped

@staudenmeir
Copy link
Contributor

What error do you get after php artisan dusk:update 74?

@petarthewizard
Copy link

No error. I get this:

ChromeDriver binaries successfully updated to version 74.0.3729.6.

@staudenmeir
Copy link
Contributor

When you run Dusk?

@petarthewizard
Copy link

I get this on some tests:

Facebook\WebDriver\Exception\SessionNotCreatedException: session not created: Chrome version must be between 70 and 73
  (Driver info: chromedriver=2.45.615279 (12b89733300bd268cff3b78fc76cb8f3a7cc44e5),platform=Linux 4.15.0-52-generic x86_64)

@staudenmeir
Copy link
Contributor

Dusk is still using the old ChromeDriver. Please try rebooting your machine (if you haven't already).

@petarthewizard
Copy link

petarthewizard commented Jun 23, 2019

Didn't think of that. It solved it! Thanks : )

@ouily
Copy link

ouily commented Jun 26, 2019

Hello,

php artisan dusk:chrome-driver 74 doesn't work behind proxy :(

@staudenmeir
Copy link
Contributor

staudenmeir commented Jun 26, 2019

@ouily What exactly doesn't work? Is there an error? What OS are you using?

@JamessBond007
Copy link

JamessBond007 commented Jul 8, 2019

My Google Chrome is up to date. Version 75.0.3770.100 (Official Build) (64-bit)
I have latest chrome driver downloaded from here.
https://chromedriver.storage.googleapis.com/index.html?path=76.0.3809.25/

Still I see this error message:

Starting ChromeDriver 75.0.3770.90 (a6dcaf7e3ec6f70a194cc25e8149475c6590e025-refs/branch-heads/3770@{#1003}) on port 44940 
Only local connections are allowed.

Please protect ports used by ChromeDriver and related test frameworks to prevent access by malicious code.
Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: session not created
from disconnected: unable to connect to renderer
  (Session info: chrome=75.0.3770.100)
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:48'
System info: host: 'C02WQ11UHV2T', ip: '192.168.2.14', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.14.5', java.version: '1.8.0_181'
Driver info: driver.version: ChromeDriver
remote stacktrace: 0   chromedriver                        0x0000000105493319 chromedriver + 3597081
1   chromedriver                        0x0000000105422f73 chromedriver + 3137395```

@staudenmeir
Copy link
Contributor

@SnehalYeole Is there a specific reason why you are using Selenium? Dusk works without it.

@JamessBond007
Copy link

JamessBond007 commented Jul 8, 2019

I am developing some front end tests using java and selenium.

@JamessBond007
Copy link

JamessBond007 commented Jul 8, 2019

I think I am looking for an answer at wrong place. I am not using Dusk.

@staudenmeir
Copy link
Contributor

@ouily The next release will add proxy support: #659

@fhferreira
Copy link

thank you @staudenmeir i've used successfully the package https://github.com/staudenmeir/dusk-updater

@ramseyjiang
Copy link

php artisan dusk:update --detect
Chrome version 76.0.3809.87 detected.
No update necessary, your ChromeDriver binary is already on version 76.0.3809.68

When I try to update to 87, it will have errors
php artisan dusk:update 76.0.3809.87

@ramseyjiang
Copy link

@staudenmeir Yes, It looks don't need to update. But when I run php artisan dusk, it will have errors under below.

Facebook\WebDriver\Exception\SessionNotCreatedException: session not created
from disconnected: unable to connect to renderer
(Session info: headless chrome=76.0.3809.87)
(Driver info: chromedriver=76.0.3809.68 (420c9498db8ce8fcd190a954d51297672c1515d5-refs/branch-heads/3809@{#864}),platform=Mac OS X 10.14.5 x86_64)

@staudenmeir
Copy link
Contributor

@ramseyjiang If you are using the right ChromeDriver, this must be an issue with Chrome or ChromeDriver.

Can you reproduce the issue on a fresh Laravel installation using the ExampleTest?

@ramseyjiang
Copy link

ramseyjiang commented Aug 1, 2019

@ramseyjiang If you are using the right ChromeDriver, this must be an issue with Chrome or ChromeDriver.

Can you reproduce the issue on a fresh Laravel installation using the ExampleTest?

@staudenmeir I have done it. I have several laravel environments. You know, before chrome 87, everyone php artisan dusk is ok, no errors. But after chrome 87 auto update, then no one can pass dusk test. The same error happens. I cannot update chrome driver to 87, it always 68. It looks chrome 68 can be ok for every chrome 76 version, but for 87, it doesn't work. Please help me. Thank you

@ramseyjiang
Copy link

Pure laravel, only install dusk, but it still has the error. @staudenmeir

Tests\Browser\ExampleTest::testBasicExample
Facebook\WebDriver\Exception\SessionNotCreatedException: session not created
from disconnected: unable to connect to renderer
(Session info: headless chrome=76.0.3809.87)
(Driver info: chromedriver=76.0.3809.68 (420c9498db8ce8fcd190a954d51297672c1515d5-refs/branch-heads/3809@{#864}),platform=Mac OS X 10.14.5 x86_64)

@staudenmeir
Copy link
Contributor

I can't reproduce this. We'll have to wait and see if other people report the same issue.

@ramseyjiang
Copy link

@staudenmeir If you upgrade your chrome to 76.0.3809.87, do you still not see the same issue? I think this issue happened because chrome driver was used in dusk it couldn't upgrade to 76.0.3809.87. I found 76.0.3809.68.zip on the official website, but I cannot find 76.0.3809.87.zip. But my chrome is 76.0.3809.87 version.

@staudenmeir
Copy link
Contributor

No, it works for me.

There is no ChromeDriver 76.0.3809.87. Only the first three parts of the version number match: http://chromedriver.chromium.org/downloads/version-selection

@ramseyjiang
Copy link

@staudenmeir Yes, I know it doesn't have ChromeDriver 76.0.3809.87. But mine still have that issue.

@l0rb
Copy link

l0rb commented Aug 6, 2019

Facebook\WebDriver\Exception\SessionNotCreatedException: session not created: This version of ChromeDriver only supports Chrome version 76
 (Driver info: chromedriver=76.0.3809.68 (420c9498db8ce8fcd190a954d51297672c1515d5-refs/branch-heads/3809@{#864}),platform=Linux 4.15.0-46-generic x86_64)

it says that it needs version 76, but that is clearly what is already installed. is there an issue with minor versions not matching? if yes the error should definitely say what it needs. or some other issue? Also, maybe this issue should be reopened?

@staudenmeir
Copy link
Contributor

@l0rb You are using ChromeDriver 76 and this version only works with Chrome 76. You need to update your browser.

@driesvints
Copy link
Member

driesvints commented Aug 6, 2019

I'm going to lock this issue as this has become a dumping ground for support. Please use a support channel if you have further issues with the chrome driver. The most common use cases have all been covered in this thread.

Make sure:

  • Your browser version and chrome driver version are the same
  • If you still experience a problem, temporarily downgrade to a lower chrome driver and chrome version

@laravel laravel locked as resolved and limited conversation to collaborators Aug 6, 2019
@driesvints driesvints pinned this issue Aug 13, 2019
@taylorotwell taylorotwell unpinned this issue Oct 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.