New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TestRunnerAgent: "TypeError: <...> is not JSON serializable" when register_run_keyword is not used #1661
Comments
Can you show an example test case? Thanks |
I'll write up a minimal test case tonight or tomorrow. Untested, typed-right-here guess:
(In case it matters, I was using Pre-patch behavior:
|
Sorry, I still cannot reproduce. Even with your other suggestion of: |
OK, I got it to reproduce. The key elements are:
I've pasted my test code into a gist: https://gist.github.com/edbrannin/f4f5d1b01e67b93b8ef19622f2a27a60 ...May as well also put it right here:
# Lib.py
from robot.libraries.BuiltIn import BuiltIn, register_run_keyword
def my_keyword(thing):
BuiltIn().run_keyword("Log", thing)
# Uncommenting this also resolves the issue.
# register_run_keyword(__name__, my_keyword) This is on Windows with I understand if you want to close this as wontfix because I made a mistake in my test library, but this still seems like a low-cost way to make the Test Runner Agent more robust against bad input. |
EDIT: Repro steps below.
If I pass an ElementTree object to a keyword, I get the below error.
I'm doing this in a for-loop, so it's causing excessive warnings to appear in the
Test Execution Errors
and keyword-logging portions of log.html.What does RIDE want with JSON-serializing keyword arguments? If it's just for the "Running this keyword..." ticker, could we replace this exception with a
repr()
fallback?The text was updated successfully, but these errors were encountered: