Yes it is possible. In python code, you can get a link to the BuiltIn library, and then use the Run Keyword keyword to run any keyword you want.
For example, you can write a python keyword that takes another keyword as an argument and runs it. The following might be how you do it in python:
from robot.libraries.BuiltIn import BuiltIn
def call_keyword(keyword):
return BuiltIn().run_keyword(keyword)
You can then pass this keyword to call up any other keyword. Here is an example set in which there is a keyword written in a robot, and then it executes python code:
*** Settings ***
| Library | MyLibrary.py
*** Keywords ***
| Example keyword
| | log | hello, world
*** Test Cases ***
| Example of calling a python keyword that calls a robot keyword
| | Call keyword | Example keyword
Notice how the test case tells call_keywordthe keyword launch method Example Keyword. Of course, you do not need to pass a keyword. The key point is to get a link to the BuiltIn library, which then allows you to call any method in this library.
Robot Framework. , . .
, , register_run_keyword, run_keyword. . , BuiltIn, python:
>>> import robot.libraries.BuiltIn
>>> help(robot.libraries.BuiltIn.register_run_keyword)