Driver info: driver.version: unknown error running Selenium and Codeception in DDEV (Mac M1)

Viewed 1638

I was using VirtualBox for development when i had a windows pc. Later i bought a Macbook M1 and installed the DDEV instead of VirtualBox. In my old development virtualbox, i installed selenium and chromedriver in Virtualbox. With this setup i could run Codeception Tests.

Since i'm using DDEV for development, i tired to install Selenium-chromedriver with following tutorials:

https://dev.to/tomasnorre/codeception-ddev-selenium-docker-36kk

https://docs.typo3.org/m/typo3/reference-coreapi/9.5/en-us/Testing/ProjectTesting.html

My docker-compose.selenium.yaml File

version: '3.6'
services:
 selenium:
   container_name: ddev-${DDEV_SITENAME}-chrome
   image: selenium/standalone-chrome:latest
   environment:
     - VIRTUAL_HOST=$DDEV_HOSTNAME
     - HTTP_EXPOSE=4444
   external_links:
     - ddev-router:$DDEV_HOSTNAME

codeception.yaml File

# suite config
suites:
   acceptance:
       actor: AcceptanceTester
       path: .
       modules:
           enabled:
               - WebDriver:
                   url: http://test.ddev.site
                   host: ddev-test-chrome
                   browser: chrome
               - \Helper\Acceptance

I get following Error when i try to execute a Test in ddev ssh with php vendor/bin/codecept run tests/FirstCest.php


  [Facebook\WebDriver\Exception\SessionNotCreatedException] Could not start a new session. Error while creating session with the driver service. Stopping driver service: Could not start a new session. Response code 500. Message: unknown error: Chrome failed to start: crashed.
  (chrome not reachable)
  (The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
Build info: version: '4.1.1', revision: 'e8fcc2cecf'
System info: host: '4916a3762177', ip: '172.18.0.3', os.name: 'Linux', os.arch: 'amd64', os.version: '5.10.76-linuxkit', java.version: '11.0.13'
Driver info: driver.version: unknown
Build info: version: '4.1.1', revision: 'e8fcc2cecf'
System info: host: '4916a3762177', ip: '172.18.0.3', os.name: 'Linux', os.arch: 'amd64', os.version: '5.10.76-linuxkit', java.version: '11.0.13'
Driver info: driver.version: unknown

Is it possible, that the errors are related to M1-Chip or am i doing something wrong?

2 Answers

This error message...

Build info: version: '4.1.1', revision: 'e8fcc2cecf'
System info: host: '4916a3762177', ip: '172.18.0.3', os.name: 'Linux', os.arch: 'amd64', os.version: '5.10.76-linuxkit', java.version: '11.0.13'
Driver info: driver.version: unknown

...implies that the ChromeDriver version wasn't detected.

Presumably the main issue is the incompatibility between the version of the binaries you are using.


Solution

Ensure that:

Related