Open bhd1hi opened 2 months ago
Hi Holger, please look into this with high priority. Thank you, Thomas
Status: Error reproduced within own test setup at my computer. Continuing now with investigation.
Hi Datta,
within your own keyword Python library you access two further keyword libraries, also implemented in Python: the bits_platform.py belonging to the BITS-Platform, and the framework.py belonging to the TA-Framework.
The bits_platform.py you import with BuiltIn().get_library_instance()
but the framework.py you import immediately with
from generic.framework.framework import framework
I am not sure about the differences but I tried to handle the framework library in the same way as the bits_platform library, because this line
framework.set_test_status_to_unknown(info_text)
causes the error message you mention in this issue.
My proposal is to import also the framework library with BuiltIn().get_library_instance()
. On my computer, with own test files, it works.
This is my code (the import paths may differ from your paths because of another file system structure in my test setup):
Import of TA-Framework library within my robot test file
Library ../libs/framework.py
In my own keyword library (mysystem.py) I define a test keyword that is simply a mapping between an own keyword and a TA-Framework keyword
@keyword
def mysystem_set_test_status_to_fail_and_continue(self):
tafw_lib = BuiltIn().get_library_instance('framework')
tafw_lib.set_test_status_to_fail_and_continue(error_type="REANIMATION", info_text="REANIMATION error info")
In my robot test file I call this keyword
mysystem_set_test_status_to_fail_and_continue
Debug log file looks good
INFO - MainThread> +--- START KEYWORD: mysystem.Mysystem Set Test Status To Fail And Continue [ ]
ERROR - An 'PERFORMANCE' error has occured!
INFO - PERFORMANCE error info
INFO - Set tag 'robot:recursive-continue-on-failure'.
FAIL - The test result is set to 'FAIL' but the test case will be continued.
INFO - MainThread> +--- END KEYWORD: mysystem.Mysystem Set Test Status To Fail And Continue (3)
An exception error occurs when running a sample test case that utilizes the THREAD keyword. The error message states: "'str' object has no attribute 'test_case_errors'". Steps to Reproduce:
Download Attached Files: Download the following files attached to this issue:
The test case should execute successfully using the THREAD keyword.
Actual Behavior:
The test case execution fails with the error message: "'str' object has no attribute 'test_case_errors'". and also another exception messages.
Additional Information:
Please let us know if you require any further details or specific test environments to aid in the troubleshooting process. Thank you for your support.