Automated Tests with Golem


Golem is a complete test automation tool for web applications (and soon for API and mobile app tests as well), it comes with a complete web module to build and run tests and a web reports module. It can run tests in parallel, locally and remotely. The Github repo can be found here:


If you already have installed Python 3.5+ and PIP, you are good to go!, Just run the following command:

pip install golem-framework

To see the detailed installation instructions check

Create a test directory

First we need to create a test directory, to do so, run the following command:

golem-admin createdirectory tutorial

This will create a new directory 'tutorial', and inside it will have a few files and folders:

  • settings.json: contains general configurations that impact all the projects inside this test directory.
  • users.json: defines the users that can access the GUI module, for now we’ll use the default (admin/admin)
  • The /drivers/ folder should contain the webdriver executables, it’s empty to guarantee that you download the latest versions of the webdriver executables yourself.
  • The /projects/ folder, also empty.

We will need to download at least one webdriver executable to run tests locally. For now, we’ll just download the chromedriver in order to use Chrome.

Go to and download the latest version for your current operating system. Put the executable inside the /drivers/ folder and make sure that the “chromedriver_path” in the setting.json is correct.

Start the web module

Run the following command:

golem gui

This will start the web module by default in the 5000 port, you can access here: http://localhost:5000

And the credentials are admin/admin

Let’s add a project

Let’s create a new project named “wikipedia”

An empty project

From the project home page, is is possible to add tests, page objects and suites.

It’s is also possible to create a project using the command line:

golem createproject my_project

Adding a new test

We will first add a test:

Adding a new test
An empty Golem test

And the code of an empty test looks like this:

description = ‘’

pages = []

def setup(data):

def test(data):

def teardown(data):

Writing the first test

We add a description to the test: “Perform a search from the initial Wikipedia page and verify that the title of the article is correct”

And we add the following steps:

  1. Navigate to
  2. Send keys ‘automation’ to (‘id’, ‘searchInput’)
  3. Click (‘css’, ‘#search-form button’)
  4. Verify that the title of the article (‘id’, ‘firstHeading’) is “Automation”

This is the final result:

First test, finished

We run the test and check that it works ok:

First test execution… success

Using Page Objects

It’s best to remove the selectors from the test, so we create two page objects:

  • home
  • article

And inside each we defined the following elements:

search_input = (‘id’, ‘searchInput’)
search_button = (‘css’, ‘#search-form button’)

title = (‘id’, ‘firstHeading’)

You can use the web page builder as well:

Adding a page object

Managing test data

Next, we remove the data from the test and put it in the data table below it. This enables us to add more data sets if we need to. If a test has multiple data sets it is going to be executed once per each row in the data table.

And at last, we remove the URL from the test and put in in an environment. We can also put it in the datatable, but since the URL is something in common with the environment and it’s going to be used by all the tests, it’s best to define it outside the test, so every test grabs the URL from a single place. This is useful when we need to run the tests in multiple environments like test, staging and production.

Defining an environment

The improved test

The final result is the following:

Improved test, page objects, data table and environment

We run it again to verify it is still working

Test executed, again

Running tests in a suite

Next we define a suite. A suite let us group tests with some extra configurations.

Adding a new test suite

This suite will run our test once per each data set, once per each browser and once per each environment. So there will be a total of 6 test executions. We define workers = 3 so it’s executed in parallel reducing total time.

An execution of a test suite
Detailed information of a single test execution

The code of this tutorial is available here:

Read the part 2 of these series here:

Photo by Diego Vitali on Unsplash