

Multiple version supportĪnother advantage that we get with Docker is that we can have multiple Chrome versions set up which we can use to execute our tests. Despite what version you have in your local machine, you can still go ahead and execute your tests within Docker. So to solve this problem we can use Docker images that come with a specific ChromeDriver as well as the browser installed which is compatible with each other. This becomes quite a common problem every time there’s a mismatch of versions. if I need to run tests in the older version then I need to downgrade my Chrome browser to v89.if I need to run tests in the latest version then I need to update the ChromeDriver to v91.In my case, my browser version was v91 and the ChromeDriver version was v89.

This error comes when the version of the ChromeDriver and the version of the local browser don’t match. If you have been running your tests without Docker, you might have seen this kind of error before - session not created: This version of ChromeDriver only supports Chrome version 89 Why should we run Selenium tests in Docker?īefore we run our tests in Docker, it’s important to understand the problems Docker can solve for us. You can also use the sample script I created in JavaScript .

We will also understand why we should run Selenium tests in Docker? Prerequisite In this tutorial, we will cover how to run Selenium tests in Docker and execute them in Chrome and Firefox browsers.
