Open
Description
For the following robot file and version
Version: Robot Framework 7.2.2 (Python 3.12.3 on linux)
*** Settings ***
Library main AS Custom
*** Test Cases ***
Verify Add
${result}= Evaluate Custom.add(1,2)
Log To Console ${result}
With the following python file named main.py (For simplicity sake)
def add(a, b):
return a + b
The following error is outputted
Evaluating expression 'Custom.add(1,2)' failed: NameError: name 'Custom' is not defined nor importable as module
Whereas, this input works as expected, and outputs 3
*** Settings ***
Library main
*** Test Cases ***
Verify Add
${result}= Evaluate main.add(1,2)
Log To Console ${result}
It would be nice to possibly expand aliases for Library Names when using Python Expressions so you can use alias instead of the full library name. This would be useful for evaluating expressions in the robot file instead of resorting to storing paths in variables, etc. I'm currently working on a solution and will open a PR when ready.
Metadata
Metadata
Assignees
Labels
No labels