How to Execute python scripts in robot framework

前端 未结 1 703
独厮守ぢ
独厮守ぢ 2021-02-11 08:51

We have already automated scenarios using python scripts(.py). We would like to execute these scripts in Robot Framework. Is there any option to execute Python scri

相关标签:
1条回答
  • 2021-02-11 09:07

    You can use the run_process keyword from the process library. It returns an object that has the status code, stdout and stderr.

    For example, this runs the script /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
    
    0 讨论(0)
提交回复
热议问题