Script Implementation
In this section, a basic test Script will be implemented, responsible for representing a test scenario in Probato. The implemented scenario will be successful login in the Probato Manager application.
The Script describes which scenario will be executed, but it does not contain execution logic — that responsibility belongs to Procedures.
Creating the Script class
The Script belongs to the same context as the Suite and represents a specific scenario within the functionality.
Step by step
- In the package
org.probato.manager.usecase.UC01, create a new package namedscript. - In the package
org.probato.manager.usecase.UC01.script, create the classUC01TC01_DoLoginSuccessfully.java. - Implement the code below:
| UC01TC01_DoLoginSuccessfully.java | |
|---|---|
The Script above describes only the intention of the scenario. No actions are executed at this level.
Associating the Script with the Suite
After creating the Script, it must be associated with the corresponding Suite.
- Open the Suite class
UC01_DoLogin. - Add the Script as an annotated field.
The @TestCase annotation indicates to Probato that this Script is part of the Suite execution.
Executing at this stage
If the project is executed at this point, Probato will report that:
the Script must contain at least one Procedure.
This behavior is expected, since the Script only describes the scenario — the logic will be implemented in the next step.
Final checklist
Before proceeding, make sure that:
- ✅ The
UC01TC01_DoLoginSuccessfullyclass was created correctly. - ✅ The Script was associated with the Suite.
- ✅ The project compiles without errors.
- ✅ The scenario is recognized by JUnit 5.
With the Script defined, the next step is to implement the Procedure, responsible for executing the scenario logic.
➡️ Continue to Procedure Implementation.