如何从机器人框架工作中执行简单的 python 脚本 [英] How to execute the simple python script from robot frame work

查看:51
本文介绍了如何从机器人框架工作中执行简单的 python 脚本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 Python 和 Robot 框架的新手.我在以下位置有一个 python 脚本C:\Python33\sample.py"

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')

我已经安装了 RF 并且我在同一位置有一个机器人文件 (test.robot),内容如下.

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"

请帮我解决这个问题

推荐答案

通过修改robot文件中下面的代码testcase正在通过

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"

这篇关于如何从机器人框架工作中执行简单的 python 脚本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆