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

Downloading ChromeDriver 115+ fails #1040

Closed
JaZo opened this issue Jul 19, 2023 · 7 comments · Fixed by #1043
Closed

Downloading ChromeDriver 115+ fails #1040

JaZo opened this issue Jul 19, 2023 · 7 comments · Fixed by #1043
Assignees
Labels

Comments

@JaZo
Copy link

JaZo commented Jul 19, 2023

Dusk Version

7.8.0

Laravel Version

9.52.10

PHP Version

8.1.16

PHPUnit Version

9.6.10

Database Driver & Version

No response

Description

Dusk fails to download ChromeDriver 115+ because Google changed the URL's.

Starting with M115 the latest Chrome + ChromeDriver releases per release channel (Stable, Beta, Dev, Canary) are available at the Chrome for Testing availability dashboard. For automated version downloading one can use the convenient JSON endpoints.

https://chromedriver.chromium.org/home

Steps To Reproduce

Run php artisan dusk:chrome-driver 115.0.5790.98

  ErrorException 

  file_get_contents(https://chromedriver.storage.googleapis.com/115.0.5790.98/chromedriver_linux64.zip): Failed to open stream: HTTP request failed! HTTP/1.1 404 Not Found

  at vendor/laravel/dusk/src/Console/ChromeDriverCommand.php:322
     318▕         }
     319▕
     320▕         $streamContext = stream_context_create($contextOptions);
     321▕
  -> 322▕         return file_get_contents($url, false, $streamContext);
     323▕     }
     324▕ }
     325▕

      +16 vendor frames 
  17  artisan:37
      Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
@driesvints driesvints added the bug label Jul 19, 2023
@driesvints driesvints self-assigned this Jul 19, 2023
@glaszig
Copy link

glaszig commented Jul 20, 2023

looks like they changed infrastructure:

i think the correct endpoint for our case here is https://googlechromelabs.github.io/chrome-for-testing/known-good-versions-with-downloads.json

@driesvints
Copy link
Member

Hey all. I sent in a PR that we're hopefully gonna merge and tag soon. I'd appreciate anyone who could try it out. I need some testing on different OS's like Linux/Windows: #1042

@rettigd
Copy link

rettigd commented Jul 20, 2023

I've run it through docker debian instances (locally and through github deployment actions) with no errors. The detection/download takes a really long time. This step has gone from 10ish seconds to 2+ minutes as a github action. Also very slow locally. No idea it it's an upstream issue or not.

@driesvints
Copy link
Member

@rettigd strange... that's indeed a lot longer. I'm not sure why that is. All I did was adopt the new download urls.

@JaZo
Copy link
Author

JaZo commented Jul 21, 2023

I experience the same performance issue as @rettigd; from a few seconds in the old situation to a minute now. I've narrowed it down to the download of the ChromeDriver zip. When I swap the file_get_contents for a curl_exec it only takes a few seconds. I also tried this solution, but that didn't make a difference.

@devphp0786
Copy link

Hi Team,

I am successfully updated the chrome binary with this solution but now dusk is not working and not able to find the elements like username password and having button to login

@hashimaziz1
Copy link

hashimaziz1 commented Aug 25, 2023

What's the best way to fix this in a Laravel 8 application? Is it safe to run composer update laravel/dusk --with-all-dependencies without running the risk of breaking things?

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