SDET Unicorns

Debug Selenium Tests in Docker using VNC Viewer

Table of Content

In the previous post, we learned how to integrate Selenium tests with Docker. In this tutorial, we will take a look at how to integrate VNC Viewer with Docker and debug Selenium tests in Docker using VNC Viewer. We will also learn why it’s important to run tests through VNC Viewer as well.

Why run Selenium tests in Docker using VNC viewer?

Originally, when I was preparing this post, I was going to name the title “View Selenium Tests in Docker using VNC Viewer”. Because I thought the goal is to be able to view the tests running in VNC.

However, the main reason we want to view tests in VNC viewer is to be able to debug any test issues that are happening inside the Docker. Typically, when tests are being triggered inside Docker container, you are not able to see anything that’s happening inside. But, with the help of the VNC viewer, you get a visual representation of exactly what’s going on inside Docker which makes it easier to debug your test issues. 


  • Install a VNC client: the one I am using in this tutorial is the RealVNC
  • Use Selenium Debug images: to be able to see what’s going inside the Docker container, you will need to use an image that has a VNC server installed. Any image that ends with -debug will have a VNC server installed
  • Map external VNC port to the Docker VNC port (5900): when you will run the docker image you will need to map the local VNC port to Docker VNC port (5900)

Run Selenium Standalone Debug Docker image 

Let’s run the selenium/standalone-chrome-debug image and map the VNC port with it — 

docker run -d -p 4444:4444 -p 5900:5900 --shm-size=2g selenium/standalone-chrome-debug:3.141.59-20210607
  • -p 4444:4444 is the port for your local machine mapping to Docker Selenium server port 4444
  • -p 5900:5900 is the port for your local VNC server mapping to Docker VNC server

Open Real VNC client

Now that we have a docker image running mapped to port 5900, we can open that port in VNC viewer. To do that, open up the RealVNC client and type in the URL —, and hit Enter. 

When prompted for a password, type secret and continue. 

VNC server pointed to port 5900

Run tests in Docker

Now it’s time to run tests in Docker, make sure your tests are pointed to port 4444 as that is what we have set up for our docker container (you can check out my previous post to learn more about that). 

Once you will run your tests, you will notice the tests can be viewable in the VNC viewer. ??

1* 8PNrM4HRB7y6vVJLA7X2w
Viewing Docker tests in VNC viewer

Check out the video below to learn more about how to execute Selenium tests in Docker and view it in VNC Viewer–

In the next tutorial, I will show you how to set up Selenium Grid and run it in Docker. 

Thanks for reading.

My Resources

Thrive Suite: The all-in-one WordPress theme I used to create my blog.
Jasper AI: My favorite AI writing tool.
Surfer SEO:  A tool to help you rank your content on the first page of Google.

Write Content Faster


Write blog posts that rank for affiliate terms!

Join our mailing list

Unlock the Secrets to Becoming a SDET Pro in the Industry!

Stay ahead of the curve! Join our mailing list for exclusive insights, tips, and the latest industry updates delivered straight to your inbox

Table of Content

Related Post


Common Types of Software Bugs

Dealing with bugs is one of the biggest headaches in the software development lifecycle. No matter how carefully someone writes code, it’s impossible to create a software product that works perfectly every time. Skipping detailed testing often causes major issues later on.

Read More »
How to inspect elements in Chrome?

How to Inspect Elements in Chrome?

Understanding how to use the “Inspect Element” feature in Chrome is a critical skill for web developers and designers alike. This tool is indispensable, no matter what web development task you’re tackling.

From resolving layout issues and debugging JavaScript to analyzing a webpage’s structure, Chrome’s Developer Tools’ “Elements” panel offers a robust suite of functionalities that enable you to delve into the HTML, CSS, and JavaScript that power websites.

Read More »