php - Codeception undefined index: ELEMENT error
i am using Codeception for acceptance testing. On my local pc i have no problems to run the tests with selenium and chromedriver. Until 1 week, it works also fine at my git, but now, there comes this error.
"[PHPUnit\Framework\Exception] Undefined index: ELEMENT"
local it is working fine without errors.
I already searched this error and found an tip, that i have to start selenium with "-enablepassthrough false". But this does not really works.
Before 1 week with all the same setup, it works fine.
this is my acceptance.suite.yml:
actor: AcceptanceTester modules: enabled: - WebDriver: url: 'https://website.com' host: 'selenium__standalone-chrome' port: 4444 browser: chrome window_size: 1920x1080
For Chrome/ChromeDriver v79 setting
This error message...
...implies that the ChromeDriver's
click()through Codeception is having an issue.
As per @reinholdfuereder's comment within the discussion facebook/php-webdriver - W3C WebDriver protocol support:
Undefined index: ELEMENTin
waitForElement()operation, which is followed by a seemingly also successful
click()operation, but fails in the
click()operation is translated into
clickElementWebDriver command that is seemingly no more supported by ChromeDriver v75.
If you are using ChromeDriver v75.x and Chromium v75.x and you are seeing this error, you need to pass an additional chromeOptions
You can find a couple of detailed discussion in:
As @DebanjanB explained, setting the said option is a solution and this is what you get by updating facebook/php-webdriver to version >= 1.7.0
I think an even more solid solution (or habit) for your application is to use a specific docker image.
Your yaml makes me guess that you're using the
selenium/standalone-chromedocker image. With their latest release (
3.141.59-palladium) they updated the included Chrome version from
Your local machine probably still runs an older version with Chrome 74 so no problems there. But whenever you rebuild the docker machine (e.g. when using some CI environment) you get the latest version. In this case a new Chrome version. Which "forces" you to also upgrade your php machine with a new facebook/php-webdriver.
I'd suggest to specify a version of the image to prevent these unwanted side effects, like
or, if you've already made it run with Chrome 75,