对不起我这个总菜鸟了。所以我尝试将Sikuli集成到我的工作RF设置中,我必须从Python转到Jython才能使用。我现在的问题是我总是收到错误。
Error in file 'C:\robot\suites\Test\Test.robot':
Importing test library 'Selenium2Library' failed: ImportError: No module named decorator
Traceback (most recent call last):
File "C:\jython2.7.0\Lib\site-packages\Selenium2Library\__init__.py", line 2, in <module>
from keywords import *
File "C:\jython2.7.0\Lib\site-packages\Selenium2Library\keywords\__init__.py", line 1, in <module>
from _logging import _LoggingKeywords
File "C:\jython2.7.0\Lib\site-packages\Selenium2Library\keywords\_logging.py", line 4, in <module>
from keywordgroup import KeywordGroup
File "C:\jython2.7.0\Lib\site-packages\Selenium2Library\keywords\keywordgroup.py", line 4, in <module>
from decorator import decorator
File "C:\jython2.7.0\Lib\site-packages\Selenium2Library\keywords\keywordgroup.py", line 4, in <module>
from decorator import decorator
PYTHONPATH:
C:\jython2.7.0\bin\jythonsikuli.bat
C:\jython2.7.0\Lib
__classpath__
__pyclasspath__/
C:\jython2.7.0\Lib\site-packages
CLASSPATH:
C:\jython2.7.0\jython.jar
C:\Sikuli\sikulix.jar
20180308 11:23:08.246 ERROR Error in file 'C:\robot\suites\Test\Test.robot':
Getting keyword names from library 'Remote' failed: Calling dynamic method
'get_keyword_names' failed: Connecting remote server at http://localhost:8270 failed:
[Errno 10061] Connection refused
答案 0 :(得分:0)
在您的错误消息中,明确定义了两个问题:
导入测试库'Selenium2Library'失败:ImportError:没有名为decorator的模块
可以通过从PIP安装相关的Python模块来解决这个问题:
pip install decorator
第二个问题即将结束:
在http://localhost:8270连接远程服务器失败: [Errno 10061] 拒绝连接
这意味着Robot Framework无法在端口8720
上建立连接。这通常是由于:
http://127.0.0.1:8270
进行连接。虽然在技术层面上经常是localhost的同义词,但它并不相同。