Skip to content

Writting Logs

The Write() method enables fine-grained logging within a TrganStep, making it ideal for capturing intermediate assertions, sub-checkpoints, or debug breadcrumbs during test execution. It supports optional timestamping for chronological clarity and allows attaching contextual screenshots to enhance traceability.

Each log entry is recorded as a LogEntry object and automatically updates the parent test’s EndTime, ensuring accurate duration tracking.

1
2
3
4
step.Write("Verified input field is visible");
step.Write("Entered username", screenshot);
step.Write("Submitted form", timeStamp: false);
step.Write("Filling Success", screenshot, false);

Note

AddStep() is designed for streamlined step creation and finalization in a single call—it does not support Write(), as the step is considered complete upon creation.