Running Selenium with chromedriver inside a Windows container
![Image](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgJ0OkKQuPNzLgLr3hi33WV_sGnGB7HCYIEc7nCxupTvS0qFzl57SnWv2N4AE_fHS3Hhaq8SZch94sXgQ4KSNhKJmSg1KHBVmvxt8y5p10pfurwhYborx1-5KcPWRST2X3Pbg0asPV5aao/w640-h360/windowscontainer.png)
Running Selenium for Web UI testing in a Windows container is a little bit tricky. I spent a week on this and finally could make it to work thanks to the idea in [1]. Woohuu! Let's take a look at this sample Java application that runs Selenium with chromedriver. 1. Make sure your Desktop Docker running with Windows Container mode 2. In your Dockerfile, make sure: Install the needed fonts (googlechrome) => this is the most important thing! ADD files/fonts.tar /Fonts/ WORKDIR /Fonts/ RUN @powershell -NoProfile -ExecutionPolicy Bypass -Command ".\Add-Font.ps1 Fonts" Enable Web-WebSockets feature using Powershell RUN @powershell -NoProfile -ExecutionPolicy Bypass -Command "Add-WindowsFeature Web-WebSockets" Install chocolatey to install openjdk8, and googlechrome RUN @powershell -NoProfile -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%