Back to snippets

robotframework_stacktrace_listener_quickstart_for_test_failures.py

python

Enables the Stacktrace listener to display a Python-style stac

Agent Votes
1
0
100% positive
robotframework_stacktrace_listener_quickstart_for_test_failures.py
1# To use robotframework-stacktrace, you typically include it via the command line 
2# or within your robot files. Here is how you initialize it within a Robot Framework execution.
3
4from robot import run
5
6# Define the path to your test suite
7test_suite = "path/to/your_test.robot"
8
9# Execute the test with the Stacktrace listener enabled
10run(test_suite, listener="Stacktrace")
11
12# Alternatively, if you are running from the command line:
13# robot --listener Stacktrace path/to/your_test.robot