How to execute the simple python script from robot frame work

試著忘記壹切 提交于 2020-01-02 15:01:09

问题


I am new to the python and Robot frame work. I have a python script at below location "C:\Python33\sample.py"

print ('Hello world')

I have installed the RF and I have a robot file (test.robot) at same location with below content.

# example.robot
*** Settings ***
| Library | Process
*** Test Cases ***
| | ${result}= | run process | python | /C:/Python33/sample.py

When I tried to execute the file from command prompt getting errors

C:\Python33>robot test.robot

Error: "Testcase name cannot be empty"

Please help me to fix this


回答1:


By modifying below code in robot file testcase is passing

*** Settings ***
| Library | Process

*** Test Cases ***
Using Kwargs
| | ${result}= | run process | python | "C:/Python33/sample.py"


来源:https://stackoverflow.com/questions/39524741/how-to-execute-the-simple-python-script-from-robot-frame-work

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!