minkphp / Mink

PHP web browser emulator abstraction
https://mink.behat.org/
MIT License
1.6k stars 280 forks source link

Support Browserless #833

Closed mrahmadt closed 1 year ago

mrahmadt commented 2 years ago

Hello

I'm trying to use https://github.com/browserless/chrome for easy management of chrome instances

When I tried to connect to it (using Chrome mink driver), I'm getting the below error, I was wondering if there is any way (or driver) that will allow me to use it

I know this maybe chrome mink driver issue but I thought to ask you if there is any other driver that will work

[2022-08-15 07:06:29] production.ERROR: Undefined array key "id" {"exception":"[object] (ErrorException(code: 0): Undefined array key \"id\" at /var/www/html/testing/vendor/dmore/chrome-mink-driver/src/ChromeDriver.php:1513)
[stacktrace]
#0 /var/www/html/testing/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(257): Illuminate\\Foundation\\Bootstrap\\HandleExceptions->handleError()
#1 /var/www/html/testing/vendor/dmore/chrome-mink-driver/src/ChromeDriver.php(1513): Illuminate\\Foundation\\Bootstrap\\HandleExceptions->Illuminate\\Foundation\\Bootstrap\\{closure}()
#2 /var/www/html/testing/vendor/dmore/chrome-mink-driver/src/ChromeDriver.php(117): DMore\\ChromeDriver\\ChromeDriver->connectToWindow()
#3 /var/www/html/testing/vendor/dmore/chrome-mink-driver/src/ChromeDriver.php(155): DMore\\ChromeDriver\\ChromeDriver->start()
#4 /var/www/html/testing/vendor/dmore/chrome-mink-driver/src/ChromeDriver.php(378): DMore\\ChromeDriver\\ChromeDriver->ensureStarted()
#5 /var/www/html/testing/vendor/behat/mink/src/Session.php(170): DMore\\ChromeDriver\\ChromeDriver->setRequestHeader()
#6 /var/www/html/testing/app/Jobs/checkQuantity.php(57): Behat\\Mink\\Session->setRequestHeader()
aik099 commented 2 years ago

From the trace, I can tell, that the $window array (inside the connectToWindow method) should have an id key, but it doesn't.

If it does work without BrowserLess, then you should report an issue to them. If it still doesn't work, the driver may not handle your page well, and you should report it to the driver repo.

stof commented 1 year ago

This should be reported to the chrome-driver issue tracker as that's the package where the error happens