I try to define a custom keywords with embedded parameter and an underscore in the custom name but robotframwork raises an “No Keyword …” error at runtime
My custom keyword implementation:
@staticmethod @keyword(name=‘MY_KEYWORD with param ${param1} is not supported’)
def test(param1: str):
print(f"This is a test for ${param1}",file= sys.stderr)
My robot file
TEST Of Custom Keyword
MY_KEYWORD with param 42 is not supported
My Execution
TEST Of Custom Keyword | FAIL |
No keyword with name ‘MY_KEYWORD with param 42 is not supported’ found. Did you mean:
MyLib.MY KEYWORD With Param ${param1} Is Not Supported
Info
If I remove the “_” => it’s work
If I remove the embedded argument => its’s work
I try to find similar issue discussion on forums/web, I don’t find anything.
Do you have another keyword with the same name without the underscore or even with in another reference or same file, just it’s asking you did you mean this resource/library.keyword. Which looks like it can’t quite figure it out.
Feels very much importing related or possible another keyword with the same name
Thanks damies13 for your proposition but it doesn’t work too if I replace “MY_KEYWORD” by “MY KEYWORD”.
Moreover using the underscore in the “name” of my test has a real interest from end-user point of view in my use-case.