{"id":6860,"library":"robotframework-stacktrace","title":"Robot Framework Stack Trace Listener","description":"Robotframework-stacktrace is a specialized listener for Robot Framework designed to enhance debugging by printing a full stack trace to the console when a test failure occurs. It addresses a common pain point where standard Robot Framework output might not provide sufficient detail to quickly pinpoint the exact line of code causing a failure. The library currently supports Robot Framework versions 4.0 and higher, with its latest release being 0.4.1. It is actively maintained as a utility to improve test debugging workflows.","status":"active","version":"0.4.1","language":"en","source_language":"en","source_url":"https://github.com/MarketSquare/robotframework-stacktrace","tags":["robot-framework","listener","testing","stack-trace","debug","automation"],"install":[{"cmd":"pip install robotframework-stacktrace","lang":"bash","label":"Install latest version"}],"dependencies":[{"reason":"This library is a listener for Robot Framework and requires it to function. Although setup.py specifies '>=3.2', the project officially states compatibility and intended use for '>=4.0'.","package":"robotframework","optional":false}],"imports":[{"note":"This library is used as a Robot Framework listener via the command line, not imported directly in Python code.","symbol":"RobotStackTracer","correct":"robot --listener RobotStackTracer <your_test_file.robot>"}],"quickstart":{"code":"# Create a simple Robot Framework test file (e.g., my_test.robot)\n# my_test.robot\n*** Settings ***\nLibrary    OperatingSystem\n\n*** Test Cases ***\nExample Failing Test\n    Log    This test will fail\n    Fail    Intentional Failure\n\n# Run Robot Framework with the listener\n# Make sure to install robotframework-stacktrace first: pip install robotframework-stacktrace\n\n# In your terminal, navigate to the directory containing my_test.robot and run:\n# robot --listener RobotStackTracer my_test.robot\n\n# You should see a detailed stack trace in the console output upon failure.","lang":"robotframework","description":"To use robotframework-stacktrace, execute your Robot Framework tests via the `robot` command, specifying `RobotStackTracer` as a listener using the `--listener` option. This will enable the stack trace output for any test failures."},"warnings":[{"fix":"Ensure your Robot Framework installation is version 4.0 or newer. Use `pip install --upgrade robotframework` to update if needed.","message":"Although `setup.py` declares a dependency on `robotframework >= 3.2`, the `robotframework-stacktrace` project's README and PyPI description explicitly state it is 'A listener for RF >= 4.0'. Using it with Robot Framework versions between 3.2 and 3.9 (inclusive) might lead to unexpected behavior or incompatibility, even if installation succeeds.","severity":"gotcha","affected_versions":"< 4.0.0"},{"fix":"Upgrade to version 0.4.1 or newer to avoid these side-effects. `pip install --upgrade robotframework-stacktrace`","message":"Versions prior to 0.4.1 had potential side-effects from library variable resolving, which could lead to unexpected behavior or incorrect test execution outcomes.","severity":"breaking","affected_versions":"< 0.4.1"},{"fix":"Use `robotframework-stacktrace` as a listener (e.g., `robot --listener RobotStackTracer ...`) to get detailed stack traces in your console output.","message":"Robot Framework does not, by default, print a detailed stack trace on failures, making it difficult to locate the exact line of code that caused an issue, especially with reusable keywords. This library solves that specific problem.","severity":"gotcha","affected_versions":"All"}],"env_vars":null,"last_verified":"2026-04-15T00:00:00.000Z","next_check":"2026-07-14T00:00:00.000Z","problems":[]}