我正在尝试将SwingLibrary包含到我的机器人框架测试中。我已经下载了整个jar的依赖项,并添加了环境变量 JYTHONPATH ,其值为 C:\ TMP \ JYTHONPATH \ SwingLibrary-1.9.6.jar; 。我正在使用:
Robot Framework 3.0.2 (Jython 2.7.0 on java1.7.0_79)
我的机器人测试非常简单:
*** Settings ***
Library OperatingSystem
Library SwingLibrary
*** Variables ***
${MESSAGE} Hello, world!
*** Test Cases ***
My Test
[Documentation] Example test
Log ${MESSAGE}
My Keyword /WA
Another Test
Should Be Equal ${MESSAGE} Hello, world!
*** Keywords ***
My Keyword
[Arguments] ${path}
Directory Should Exist ${path}
我使用以下命令运行脚本:
jython -vv -m robot -L TRACE -d out tests.robot
然后抱怨
Imported library 'SwingLibrary' contains no keywords.
当我使用详细输出运行jython时,我有关于SwingLibrary的以下输出:
import: trying source D:\WA\Z-TMP\test\SwingLibrary
import: trying precompiled with no source D:\WA\Z-TMP\test\SwingLibrary$py.class
import: trying source C:\TMP\JYTHONPATH\SwingLibrary-1.9.6.jar\SwingLibrary
import: trying precompiled with no source C:\TMP\JYTHONPATH\SwingLibrary-1.9.6.jar\SwingLibrary$py.class
import: trying source C:\jython2.7.0\Lib\SwingLibrary
import: trying precompiled with no source C:\jython2.7.0\Lib\SwingLibrary$py.class
import: trying SwingLibrary in packagemanager for path None
import: trying SwingLibrary as java class in SysPathJavaLoader
import: 'SwingLibrary' as java class
import: 'SwingLibrary' as java package
[ WARN ] Imported library 'SwingLibrary' contains no keywords.