You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
For the following robot file and version
Version: Robot Framework 7.2.2 (Python 3.12.3 on linux)
With the following python file named main.py (For simplicity sake)
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
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.
The text was updated successfully, but these errors were encountered: