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

Comments

@markdwhite
Copy link

commented Apr 24, 2019

  • 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

This comment has been minimized.

Copy link

commented Apr 24, 2019

I'm facing the exact same issue.

@ahtinurme

This comment has been minimized.

Copy link

commented Apr 24, 2019

Same here.

@tentus

This comment has been minimized.

Copy link

commented Apr 24, 2019

Same.

@rmeira

This comment has been minimized.

Copy link

commented Apr 24, 2019

same issue.

@staudenmeir

This comment has been minimized.

Copy link
Contributor

commented Apr 24, 2019

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

@markdwhite

This comment has been minimized.

Copy link
Author

commented Apr 25, 2019

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

This comment has been minimized.

Copy link
Contributor

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: http://chromedriver.chromium.org/downloads/version-selection

Why doesn't the updater work for CI?

@markdwhite

This comment has been minimized.

Copy link
Author

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 markdwhite closed this Apr 25, 2019
@markdwhite

This comment has been minimized.

Copy link
Author

commented Apr 25, 2019

I just closed this by mistake...

@markdwhite markdwhite reopened this Apr 25, 2019
@flexnst

This comment has been minimized.

Copy link

commented Apr 25, 2019

same issue.

@driesvints

This comment has been minimized.

Copy link
Member

commented Apr 25, 2019

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

bjuppa added a commit to kontenta/kontour that referenced this issue Apr 25, 2019
@peterfox

This comment has been minimized.

Copy link

commented Apr 25, 2019

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

This comment has been minimized.

Copy link

commented Apr 26, 2019

Same problem...

@bobo52310

This comment has been minimized.

Copy link

commented Apr 26, 2019

Same issue.

driesvints added a commit to driesvints/dusk that referenced this issue Apr 26, 2019
This command will allow users to update their chrome driver for their OS. It has a flag that will also allow users to update every binary if they want. I've added this to the install command so the driver is updated whenever the install command is run. This means we don't have to update the docs.

I wrote this as an install command so we can remove the binaries in a future version of Dusk and always have them installed with this command. This will save having them to be packaged with the repo. It's also written in such a way that it only installs the binary for the current OS.

Fixes laravel#641
driesvints added a commit to driesvints/dusk that referenced this issue Apr 26, 2019
This command will allow users to update their chrome driver for their OS. It has a flag that will also allow users to update every binary if they want. I've added this to the install command so the driver is updated whenever the install command is run. This means we don't have to update the docs.

I wrote this as an install command so we can remove the binaries in a future version of Dusk and always have them installed with this command. This will save having them to be packaged with the repo. It's also written in such a way that it only installs the binary for the current OS.

Fixes laravel#641
driesvints added a commit to driesvints/dusk that referenced this issue Apr 26, 2019
This command will allow users to update their chrome driver for their OS. It has a flag that will also allow users to update every binary if they want. I've added this to the install command so the driver is updated whenever the install command is run. This means we don't have to update the docs.

I wrote this as an install command so we can remove the binaries in a future version of Dusk and always have them installed with this command. This will save having them to be packaged with the repo. It's also written in such a way that it only installs the binary for the current OS.

Fixes laravel#641
@driesvints

This comment has been minimized.

Copy link
Member

commented May 2, 2019

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

@staudenmeir

This comment has been minimized.

Copy link
Contributor

commented Jun 23, 2019

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

@petarvasilev91

This comment has been minimized.

Copy link

commented Jun 23, 2019

No error. I get this:

ChromeDriver binaries successfully updated to version 74.0.3729.6.

@staudenmeir

This comment has been minimized.

Copy link
Contributor

commented Jun 23, 2019

When you run Dusk?

@petarvasilev91

This comment has been minimized.

Copy link

commented Jun 23, 2019

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

This comment has been minimized.

Copy link
Contributor

commented Jun 23, 2019

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

@petarvasilev91

This comment has been minimized.

Copy link

commented Jun 23, 2019

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

@ouily

This comment has been minimized.

Copy link

commented Jun 26, 2019

Hello,

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

@staudenmeir

This comment has been minimized.

Copy link
Contributor

commented Jun 26, 2019

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

@JamessBond007

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link
Contributor

commented Jul 8, 2019

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

@JamessBond007

This comment has been minimized.

Copy link

commented Jul 8, 2019

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

@JamessBond007

This comment has been minimized.

Copy link

commented Jul 8, 2019

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

@staudenmeir

This comment has been minimized.

Copy link
Contributor

commented Jul 9, 2019

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

@fhferreira

This comment has been minimized.

Copy link

commented Jul 18, 2019

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

@ramseyjiang

This comment has been minimized.

Copy link

commented Aug 1, 2019

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

This comment has been minimized.

Copy link

commented Aug 1, 2019

@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

This comment has been minimized.

Copy link
Contributor

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?

@ramseyjiang

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

commented Aug 1, 2019

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

This comment has been minimized.

Copy link
Contributor

commented Aug 1, 2019

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

@ramseyjiang

This comment has been minimized.

Copy link

commented Aug 2, 2019

@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

This comment has been minimized.

Copy link
Contributor

commented Aug 2, 2019

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

This comment has been minimized.

Copy link

commented Aug 2, 2019

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

@l0rb

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link
Contributor

commented Aug 6, 2019

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

@driesvints

This comment has been minimized.

Copy link
Member

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
You can’t perform that action at this time.