How to Execute python scripts in robot framework

前端 未结 1 631
野的像风
野的像风 2021-02-11 08:42

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:08

    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)
提交回复
热议问题