我们已经使用python脚本(.py)实现了自动化方案.我们想在Robot Framework中执行这些脚本.是否有任何选项可以在RF中执行Python脚本.
请问任何人请在这里建议我.
您可以使用流程库中的run_process关键字.它返回一个具有状态代码stdout和stderr的对象.
例如,这会运行脚本/tmp/helloworld.py:
# example.robot
*** Settings ***
| Library | Process
*** Test Cases ***
| Example of running a python script
| | ${result}= | run process | python | /tmp/helloworld.py
| | Should be equal as integers | ${result.rc} | 0
| | Should be equal as strings | ${result.stdout} | hello, world
Run Code Online (Sandbox Code Playgroud)