org.openqa.selenium.NoSuchSessionException: Unable to find session with ID error testing with Behat/Mink and Selenium2Driver in docker container

This error message…

org.openqa.selenium.NoSuchSessionException: Unable to find session with ID: url\n
Build info: version: '4.0.0-alpha-6', revision: '5f43a29cfc'\n
System info: host: 'fca78c7f81e6', ip: '172.28.0.3', os.name: 'Linux', os.arch: 'amd64', os.version: '5.4.0-42-generic', java.version: '1.8.0_252'\n
Driver info: driver.version: unknown

…implies that the ChromeDriver was unable to initiate/spawn a new Browsing Context i.e. Chrome Browser session which gets reflected in the logs as:

Driver info: driver.version: unknown

Hence moving forward you see the error:

PHP Fatal error: Call to a member function click() on null

and the most probhable cause is the incompatibility between the version of the binaries you are using.


Solution

Ensure that:

  • ChromeDriver is updated to current ChromeDriver v84.0 level.
  • Chrome is updated to current Chrome Version 84.0 level. (as per ChromeDriver v84.0 release notes)
  • If your base Web Client version is too old, then uninstall it and install a recent GA and released version of Web Client.
  • Take a System Reboot.
  • Always invoke driver.quit() within tearDown(){} method to close & destroy the WebDriver and Web Client instances gracefully.

References

You can find a couple of relevant detailed discussions in:

Leave a Comment