Getting setup quickly with Selenium and Bitbucket Pipelines

Albert Ngo
3 min readMar 17, 2020

It may come as no surprise to many others that Selenium is one of the most popular frameworks for automated testing. Getting it into integrated into a dockerized Pipeline like Bitbucket Pipelines, however, did not end up being a very straightforward process for getting myself up and running immediately.

I do acknowledge the best practice would be to push your own customized Docker image (with both Selenium and your testing language of choice) to a container registry, but if you don’t want to get your testing repository into a dockerfile, and want to use Bitbucket Pipelines, then this short tutorial is for you.

Let’s set up your pipeline:

Create your repository (if you haven’t already)

Head over to the settings, and under the Pipelines header, click on the settings, and tick the box to Enable Pipelines

In your bitbucket-pipelines.yml file, follow this general template:

Let’s break it down a bit here:

This is simply a docker image pre-defined with maven for getting started quickly. You would pick the appropriate docker image with the language of your tests.

This defines a service that runs alongside your pipeline step. In this case, we’re selecting to use the standalone Selenium Chrome docker image

This is where the commands are run. What’s important to note here is that after the script…

Albert Ngo