What is the advantage of docker for test automation or even manual tests?


2 Answers 2


In order to test something, you need to install it somewhere, i.e. in a runtime environment. In the process of running your test, you may change the runtime environment in ways that you need to clean up before you run your next test. There are two ways to clean up: you can undo the changes, or you can throw the environment away and create a new one from scratch.

If your runtime environment is an entire physical machine, creating the environment from scratch could involve reformatting the disk, reinstalling the operating system, and so on. That's a lengthy, expensive process. And if you only have one physical machine, that limits how many tests you can run at the same time.

If your runtime environment is a virtual machine, creating an environment from scratch might only mean cloning an existing image. That is probably faster than reimaging a physical machine. You can probably run multiple virtual machines on the same physical machine, too, which means you can do more testing in parallel. However, it still takes as long to start your virtual machine as it does to boot an operating system.

If your runtime environment is a Docker container, you get most of the advantages of running in a virtual machine, but you can run even more Docker containers on a physical machine than you can virtual machines. Creating a Docker container from a Docker image is almost simultaneous. And a Docker container does not need to boot an entire operating system, so its startup time is much faster than that of a virtual machine.

So what is the advantage of Docker for test automation or even manual tests? Docker provides a lightweight way to create disposable runtime environments for running the software that you want to test.


I have been looking for the same, and I have found following some useful blogs on it. Hopefully it will help you to resolve your query.

  1. Docker container for running browser tests - https://medium.com/@georgediaz/docker-container-for-running-browser-tests-9b234e68f83c#.o8ch92lkt

  2. Running headless Selenium WebDriver tests in Docker containers - https://medium.com/@griggheo/running-headless-selenium-webdriver-tests-in-docker-containers-342fdbabf756#.k5gbh46sd

  3. Selenium Grid Cluster Example With docker-compose (formerly fig) - https://medium.com/@kevanahlquist/selenium-grid-cluster-example-with-docker-and-fig-24943a5eca42#.h3x3z12ms

  4. Setting up Jenkins to run headless Selenium tests in Docker containers - https://medium.com/@griggheo/setting-up-jenkins-to-run-headless-selenium-tests-in-docker-containers-99528390bce7#.xic6to28m

  • Hi Jeevan- link only answers are discouraged here. Please add some description to your answer. Feb 10, 2016 at 14:57
  • Hi log_file, Yeah I understand even I had done research and found this useful blogs, It won't be meaningful if we copy paste point from blogs. So I have provide this links :) Feb 10, 2016 at 15:17

Not the answer you're looking for? Browse other questions tagged or ask your own question.