How to fix no such session chromeDriver error

3 comments, 646 points
no such session chromeDriver
no such session chromeDriver

How to fix no such session chromeDriver error

In the last couple of days we moved our Ruby cucumber capybara tests to selenium 3. Such a big pain with Firefox driver and geckodriver which is not reliable at all. We are running our tests using parallel docker containers and xvfb headless browser.

Because Firefox is not stable we chose as main driver google chrome headless. The migration using google chrome was pretty easy , there was just few issues that we had to handle them in a different way.

But when we had our first build up and running in jenkins we had quite a lot of failures with no such session.

I started to dig into it and and there was couple of places coming with a solution but non of them were complete for me , so that’s why I decided to share my experience if any other people will run in the same situation like me.

Fix for no such session

Because we run our tests in docker containers , looks like dev/shm size is 64mb , so inside docker-compose.yml I added :

shm_size: 512M

We also chose to run the container in privileged mode:

docker run --privileged

Running in privileged mode indeed gives the container all capabilities. But it is good practice to always give a container the minimum requirements it needs If you look at Docker docs they also refer to this flag

Full container capabilities (–privileged)

The –privileged flag gives all capabilities to the container, and it also lifts all the limitations enforced by the device cgroup controller. In other words, the container can then do almost everything that the host can do. This flag exists to allow special use-cases, like running Docker within Docker.

After all these changes you should be go to go.

Happy Testing!


Like it? Share with your friends!

3 comments, 646 points
Test engineer


Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  1. Thank you a lot! Been searching on the web for a solution for this for an hour or so until I found your site. Everything working on our CI now! Much love