Robot Framework-RIDE,导入Java库 [英] Robot Framework-RIDE,Import Java Libraries

查看:49
本文介绍了Robot Framework-RIDE,导入Java库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

已安装 Robot Framework IDE.安装后如何将jar文件导入RIDE.

Have Installed Robot Framework IDE. After installation, how to import jar files into RIDE.

已尝试通过测试套件中存在的添加导入选项添加 jar.但无法识别(未找到关键字错误).

Have tried to add jar through add import option present in the test suite. but its not being recognized(Keywords not found error).

如果我们导入 jar 文件,测试是否应该在执行 Profile 中作为 Jybot 运行?

If we import the jar files should the test run in execution Profile as Jybot?

当我尝试以 Jybot 身份运行测试用例时,我得到如下信息:

When i try to run the test case as Jybot,am getting info as follow:

未找到机器人框架安装.要运行 tets,您需要单独安装 Robot Framework.有关安装说明,请参阅 http://robotframework.org.

Robot Framework installation not found. To run tets, you need to install Robot Framework separately. See http://robotframework.org for installation instructions.

推荐答案

首先您需要安装 jython.您可以在此处查看说明.这将使您能够使用 Jybot 运行测试.

First you will need to install jython. You can check the instructions here. This will enable you to run tests using Jybot.

然后您需要确保您的 Java 库在类路径中.或者您可以为 Jybot 设置 --pythonpath 参数.

Then you need to make sure your Java library is in the classpath. Or you can set the --pythonpath argument for Jybot.

这是我用来运行我的测试的(只需将它放在参数"输入字段中):

This is what I use to run my tests (just put this in the 'Arguments' input field):

--pythonpath lib\STAR.jar:lib --escape star:STAR

使用 : 分隔其他文件夹.--escape star:STAR 参数允许使用 * 来包含文件夹中的所有 *.jar 文件.

Use : to separate additional folders. The --escape star:STAR argument enables the use of * to include all *.jar files in the folder.

我在将库包含在名称中带有空格的文件夹中时遇到了一些麻烦,因此我使用 --escape space:== 符号替换为空格.例如:

I had some trouble with including libraries in folders with space in their name so I use --escape space:= which replaces the = symbol with a space. For example:

--pythonpath "path=with=spaces\lib\STAR.jar" --escape star:STAR --escape space:=

如果您想在 Jython 中使用 selenium2 库,我建议您下载 selenium2library 用于 Java.

If you want to use the selenium2 library with Jython I suggest you download the selenium2library for Java.

这篇关于Robot Framework-RIDE,导入Java库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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