← back to section

A tester's work runs into volume and repetition. Checking by hand that the totals add up across a thousand orders is impossible — you can sample, and a sample is not yet a check. Comparing two exports of five hundred rows is possible too, but the eye glazes over by the hundredth line.

The same work takes seconds in code, and code does not get tired. Hence the simple answer to "why should a tester program": to check what cannot be checked by hand.

Why Python

It reads almost like English. To print a line, Python says print("hello"); Java needs System.out.println("hello") inside a class and a method you also have to declare. While you are learning, every extra word has to be explained, and you have nothing to explain it with yet.

Everything a tester needs is already written. Requests to a service, parsing the response, working with tables, running checks — ready-made libraries that install with one command.

It is the language of testing. Your questions have been asked before, and you can show your code to colleagues and discuss it.

What you will be able to do

Not "know Python" — that is too vague. Four concrete skills:

  • parse a service response and check the fields that matter;
  • compute from an export what the interface never shows;
  • compare two data sets and find what went missing and what appeared extra;
  • write an autotest that checks the API and fails when the service is broken.

The last point is the goal of the section; the other three lead up to it.

How to run the first line

There are two ways, and the second one is better at the start.

Install Python. Download the installer for your system from python.org. On Windows tick "Add Python to PATH" in the installer — without it the python command is not found. Check the install:

python3 --version

An answer like Python 3.12.4 means the language is in place. Then create a file first.py with one line in it and run it with python3 first.py:

live example

print("Hello, tester")
Run

Running examples is part of paid access. There the same code runs inside the article: editor, run and check next to the paragraph. Three free days →

Start in the trainer. Nothing to install: the Python trainer is already open, the code is written in the browser and runs on a button. The first task is that very line. The install comes later, when you get to autotests in a work project.

How working with code feels

Three things worth accepting right away — they save weeks.

A program runs top to bottom, line by line. What is written first happens first.

The computer takes you literally. A capital letter instead of a lowercase one, a missing bracket, a typo in a name — an error. The language does not guess, it executes:

live example

# error: not like this — Python tells capital and lowercase letters apart
Print("report ready")
Run

Running examples is part of paid access. There the same code runs inside the article: editor, run and check next to the paragraph. Three free days →

live example

# like this
print("report ready")
Run

Running examples is part of paid access. There the same code runs inside the article: editor, run and check next to the paragraph. Three free days →

The first example stops at NameError: name 'Print' is not defined: the language does not know the name Print, but it does know print.

An error is a message, not a disaster. Python says what did not add up and on which line. Reading those messages is half the skill; in the trainer they appear right under your code.

How to go through the section

Every article ends with trainer tasks, and they are meant to be solved, not skimmed: reading about code and writing code are different skills. The order is not accidental: strings are needed to parse responses, dicts to read a service response, functions to keep a check in one place.

In short

  • A tester needs code to check what hands cannot: volume, repetition, data comparison.
  • Python wins on readability, ready-made libraries for a tester's tasks, and being the language the profession speaks.
  • It is easier to start in the trainer: the code is written and run in the browser, nothing to install.
  • The install from python.org comes later, for autotests in a real project.
  • A program runs top to bottom and takes you literally: Print and print are different names, and the error message points at where you stumbled.