Lesson 07 of 20 · Beginner course
Run a test and read the result
Now you will ask Bruster to read your file and perform its check. Keep the test small so you can see the whole journey from command to result.
Before starting, confirm that the practice page opens in your normal browser. The downloaded example uses that public address, so this first exercise needs an internet connection.
1. Open a terminal in your practice folder
Use the same folder-opening method from the setup lesson. The terminal needs to be in bruster-practice, where you saved the program and first-check.bru.
The folder a terminal is currently using is called its working directory. When you give Bruster a test filename without a folder path, it looks in this directory. This is why being in the right folder matters.
You can list the folder contents with ls on macOS/Linux or Get-ChildItem in PowerShell. You should see both the program and your test file in the list.
2. Run the test
Choose the command for your computer. Copy the whole line into the terminal and press Enter once.
./bruster test first-check.bru --visibleWindows PowerShell.\bruster.exe test first-check.bru --visibletest tells Bruster to use its test runner. first-check.bru is the file it should read. --visible asks it to show the browser window while it works.
A small test may finish quickly, and its window may close before you have time to study it. That is normal. The terminal result is the reliable place to see whether the check passed.
3. Read the result
On a successful run, you should see a line beginning with PASS and the test name the practice page opens. At the end, you should see:
1 passed, 0 failedBruster also prints a folder path after the label Artifacts:. An artifact is a file kept from a run, such as a report or screenshot. You will learn to use these files in lesson 16. For now, notice that a results folder was created.
The terminal prompt returns when the command has finished. You can then type another command. You do not need to open a new terminal for every test.
4. Run it a second time
Repeat the same command. You should again see one pass. This is the first benefit of automation: you can repeat a specific check without performing each browser action yourself.
Each test gets a fresh browser process and its own stored browser data, called a profile. It does not reuse the tabs you already have open in your personal browser. Changing the form fields in your normal browser therefore does not change the starting state of this test.
If the run does not pass
- Program not found: check that the Bruster executable is in this folder and that you used the command for your operating system.
- Test file not found: check the filename and working directory. Look for a hidden
.txtextension. - Unknown test command: return to the setup lesson and use a build with the test runner.
- Page or connection error: confirm the demo address works in your browser and try again when the connection is available.
If a different error appears, save its wording. It is more useful than a description such as “nothing worked.” Lesson 17 explains how to investigate failures.
Try it: change one run option
Run the same command without --visible. The test should still work, but the browser window stays off-screen. The check in the file has not changed; only how the run is displayed has changed.
You have completed your first automated check
You can locate a test file, run it, and find the pass/fail summary. Next, you will learn what its lines actually mean.