lecture 13 of 160 completed

The test that only fails on the build server

Selenium gives you fewer tools here, so you have to add your own evidence. Here is the method.

What you'll learn

  • How to investigate a failure you cannot reproduce
  • What evidence Selenium collects, which is nothing by default
  • How to tell an environment problem from a test problem

This will happen to you, probably in your first month. A test fails on the build server about once in ten runs. On your machine it passes every time. Someone re-runs the build, it goes green, and everyone moves on.

Do not move on. Selenium does not record video or traces for you, so your first job is to make sure a failure leaves evidence behind.

Step 1. Save a screenshot when a test fails. Add this to your teardown:

full course

Keep reading with the full course

The Foundations track and the first lessons in each framework are free. This lesson needs full course access. A course plan includes all lessons for Playwright, Cypress and Selenium.

See course plans →