I have some robot keywords written in FlowKeywords.txt
and it is been used in my Robot Test cases.
Can I call these keywords from a Python script?
I have checked this link but it includes importing the Python file in the robot test case and then call it from robot side.
I need to use these keywords in the Python script.
This is test.robot
file
*** Settings ***
*** Test Cases ***
Test
Example keyword
*** Keywords ***
Example keyword
log hello, world
Below is Python file runkw.py
:
from robot.libraries.BuiltIn import BuiltIn
def call_keyword(keyword):
return BuiltIn().run_keyword(keyword)
How can I call KW 'Example keyword' from the Python file itself?
run_keyword
, which requires an instance ofBuiltIn
which requires a special context object, which requires... etc. – Bryan Oakley