Skip to main content

A listener that prints a Stack Trace to console to faster find the code section where the failure appears.

Project description

robotframework-stacktrace

A listener for RF >= 4.0 that prints a Stack Trace to console to faster find the code section where the failure appears.

Installation

pip install robotframework-stacktrace

Usage

robot --listener RobotStackTracer <your file.robot>

Example

Old Console Output:

robot -d logs TestCases/14_Browser/01_CarConfig.robot
==============================================================================
01 CarConfig                                                                  
==============================================================================
Configure Car with Pass                                               | FAIL |
TimeoutError: page.selectOption: Timeout 3000ms exceeded.
=========================== logs ===========================
waiting for selector ""Basismodell" >> ../.. >> select"
  selector resolved to visible <select _ngcontent-c7="" class="maxWidth ng-untouched ng…>…</select>
  selecting specified option(s)
    did not find some options - waiting... 
============================================================
Note: use DEBUG=pw:api environment variable to capture Playwright logs.
------------------------------------------------------------------------------
Configure Car with wrong Acc                                          | FAIL |
TimeoutError: page.check: Timeout 3000ms exceeded.
=========================== logs ===========================
waiting for selector "//span[contains(text(),'aABS')]/../input"
============================================================
Note: use DEBUG=pw:api environment variable to capture Playwright logs.
------------------------------------------------------------------------------
Configure Car with car Acc                                            | FAIL |
TimeoutError: page.click: Timeout 3000ms exceeded.
=========================== logs ===========================
waiting for selector "[href="/config/summary/wrong"]"
============================================================
Note: use DEBUG=pw:api environment variable to capture Playwright logs.
------------------------------------------------------------------------------
01 CarConfig                                                          | FAIL |
3 tests, 0 passed, 3 failed
==============================================================================
Output:  /Source/RF-Schulung/02_RobotFiles/logs/output.xml
Log:     /Source/RF-Schulung/02_RobotFiles/logs/log.html
Report:  /Source/RF-Schulung/02_RobotFiles/logs/report.html

New Stack Trace Output

 robot -d logs --listener RobotStackTracer TestCases/14_Browser/01_CarConfig.robot
==============================================================================
01 CarConfig                                                                  
==============================================================================
Configure Car with Pass                                               ..
Traceback (most recent call last):
  File  "/Source/RF-Schulung/02_RobotFiles/TestCases/14_Browser/01_CarConfig.robot:23", in "01 CarConfig"
    Configure Car with Pass    
  File  "/Source/RF-Schulung/02_RobotFiles/TestCases/14_Browser/01_CarConfig.robot:27", in "Configure Car with Pass"
    Select aMinigolf as model    
  File  "/Source/RF-Schulung/02_RobotFiles/TestCases/14_Browser/functional_keywords.resource:14", in "Select aMinigolf as model"
    Select Options By    ${select_CarBaseModel}    text    ${basemodel}
Configure Car with Pass                                               | FAIL |
TimeoutError: page.selectOption: Timeout 3000ms exceeded.
=========================== logs ===========================
waiting for selector ""Basismodell" >> ../.. >> select"
  selector resolved to visible <select _ngcontent-c7="" class="maxWidth ng-untouched ng…>…</select>
  selecting specified option(s)
    did not find some options - waiting... 
============================================================
Note: use DEBUG=pw:api environment variable to capture Playwright logs.
------------------------------------------------------------------------------
Configure Car with wrong Acc                                          ....
Traceback (most recent call last):
  File  "/Source/RF-Schulung/02_RobotFiles/TestCases/14_Browser/01_CarConfig.robot:37", in "01 CarConfig"
    Configure Car with wrong Acc    
  File  "/Source/RF-Schulung/02_RobotFiles/TestCases/14_Browser/01_CarConfig.robot:42", in "Configure Car with wrong Acc"
    Select Accessory    aABS
  File  "/Source/RF-Schulung/02_RobotFiles/TestCases/14_Browser/functional_keywords.resource:38", in "Select Accessory"
    Check Checkbox    //span[contains(text(),'${accessory}')]/../input
Configure Car with wrong Acc                                          | FAIL |
TimeoutError: page.check: Timeout 3000ms exceeded.
=========================== logs ===========================
waiting for selector "//span[contains(text(),'aABS')]/../input"
============================================================
Note: use DEBUG=pw:api environment variable to capture Playwright logs.
------------------------------------------------------------------------------
Configure Car with car Acc                                            ..      
Traceback (most recent call last):
  File  "/Source/RF-Schulung/02_RobotFiles/TestCases/14_Browser/01_CarConfig.robot:50", in "01 CarConfig"
    Configure Car with car Acc    
  File  "/Source/RF-Schulung/02_RobotFiles/TestCases/14_Browser/01_CarConfig.robot:61", in "Configure Car with car Acc"
    Set wrong Car Name    ${car}
  File  "/Source/RF-Schulung/02_RobotFiles/TestCases/14_Browser/functional_keywords.resource:53", in "Set wrong Car Name"
    Click    ${car_name}
Configure Car with car Acc                                            | FAIL |
TimeoutError: page.click: Timeout 3000ms exceeded.
=========================== logs ===========================
waiting for selector "[href="/config/summary/wrong"]"
============================================================
Note: use DEBUG=pw:api environment variable to capture Playwright logs.
------------------------------------------------------------------------------
01 CarConfig                                                          | FAIL |
3 tests, 0 passed, 3 failed
==============================================================================
Output:  /Source/RF-Schulung/02_RobotFiles/logs/output.xml
Log:     /Source/RF-Schulung/02_RobotFiles/logs/log.html
Report:  /Source/RF-Schulung/02_RobotFiles/logs/report.html

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

robotframework-stacktrace-0.0.2.tar.gz (4.3 kB view details)

Uploaded Source

Built Distribution

File details

Details for the file robotframework-stacktrace-0.0.2.tar.gz.

File metadata

  • Download URL: robotframework-stacktrace-0.0.2.tar.gz
  • Upload date:
  • Size: 4.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.0

File hashes

Hashes for robotframework-stacktrace-0.0.2.tar.gz
Algorithm Hash digest
SHA256 51c40f6f90560108f089fa846c1562e4af98c210ef86cd5a86764c976deda4f0
MD5 e4e8a7ecb08a6f933d8ca834bfbd86de
BLAKE2b-256 09c1ef11df446f5e4dd2ec7306375e86ce4fbc1fef63e9ece004c2906a0a7ece

See more details on using hashes here.

Provenance

File details

Details for the file robotframework_stacktrace-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: robotframework_stacktrace-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 7.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.0

File hashes

Hashes for robotframework_stacktrace-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e26008b9a87331211d34226d8aef46f1db95934fc90cf30296261968211d2dfe
MD5 7c37aa1c19938f6a85cd0858b4156203
BLAKE2b-256 382191c4e10791e9128276ac74a68cbf2934645661750f91df1947cedf3c54ab

See more details on using hashes here.

Provenance

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page