instaclick / php-webdriver

W3C and Selenium 2 webdriver "thin client" for php 5.3+ and namespaces.
Other
436 stars 62 forks source link

Support PHP 7.4 #107

Closed MarvinKlar closed 3 years ago

MarvinKlar commented 3 years ago

Hello everyone,

I was about to update a project to PHP 7.4. While doing so I got the following error:

Behat\Testwork\Call\Exception\CallErrorException: Notice: Trying to access array offset on value of type null in vendor/instaclick/php-webdriver/lib/WebDriver/AbstractWebDriver.php line 156 in vendor/behat/behat/src/Behat/Testwork/Call/Handler/RuntimeCallHandler.php:90
      Stack trace:
      #0 vendor/instaclick/php-webdriver/lib/WebDriver/AbstractWebDriver.php(156): Behat\Testwork\Call\Handler\RuntimeCallHandler->handleError()
      #1 vendor/instaclick/php-webdriver/lib/WebDriver/WebDriver.php(70): WebDriver\AbstractWebDriver->curl()
      #2 vendor/behat/mink-selenium2-driver/src/Selenium2Driver.php(300): WebDriver\WebDriver->session()
...

I only get this error on PHP 7.4. Am I missing something or is this a bug? Would you mind fixing it if so?

MarvinKlar commented 3 years ago

This should be this line: if ((int) $result['status'] !== 0) {

dhinakaran60 commented 3 years ago

Any update on this issue..i am facing the similar kind of error

Behat\Testwork\Call\Exception\CallErrorException: Notice: Trying to access array offset on value of type null in vendor/instaclick/php-webdriver/lib/WebDriver/AbstractWebDriver.php line 156 in vendor/behat/behat/src/Behat/Testwork/Call/Handler/RuntimeCallHandler.php:90 Stack trace:

0 vendor/instaclick/php-webdriver/lib/WebDriver/AbstractWebDriver.php(156): Behat\Testwork\Call\Handler\RuntimeCallHandler->handleError()

  #1 vendor/instaclick/php-webdriver/lib/WebDriver/WebDriver.php(70): WebDriver\AbstractWebDriver->curl()
  #2 vendor/behat/mink-selenium2-driver/src/Selenium2Driver.php(300): WebDriver\WebDriver->session()
  #3 vendor/behat/mink/src/Session.php(70): Behat\Mink\Driver\Selenium2Driver->start()
GautierDig commented 3 years ago

Same issue here. Any update on this ?

robocoder commented 3 years ago

Which driver binary (and version) are you all using?

GautierDig commented 3 years ago

I am using the chromedriver 91.0.4472.101

robocoder commented 3 years ago

It's not the root cause of the problem but the reason this notice appears in PHP 7.4 is due to this change:

Array-style access of non-arrays

Trying to use values of type null, bool, int, float or resource as an array (such as $null["key"]) will now generate a notice.

robocoder commented 3 years ago

Please also indicate which PHP version you're running. A couple of (major?) curl POSTFIELDS bugs were fixed in 7.4.2 and 7.4.15.

GautierDig commented 3 years ago

I am using PHP 7.4.15

robocoder commented 3 years ago

Please confirm this is fixed for you in 1.4.9. Thanks.

GautierDig commented 3 years ago

I updated to 1.4.9 and it worked as expected. I was originally using 1.4.7.