【问题标题】:Importing Selenium2Library导入 Selenium2Library
【发布时间】:2016-06-14 10:25:40
【问题描述】:

无法为 Robotframework 导入 Selenium2Library。

在尝试验证我的 Selenium2Library 安装时,我在 Python shell 中收到以下错误

>>> import Selenium2Library
Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    import Selenium2Library
  File "C:\Users\user\AppData\Local\Programs\Python\Python35-32\lib\site-packages\robotframework_selenium2library-1.7.4-py3.5-win32.egg\Selenium2Library\__init__.py", line 2, in <module>
    from keywords import *
ImportError: No module named 'keywords'
>>> 

我之前在使用不同的模块时遇到过这个错误,并且能够使用 easy_install(模块名称)修复它,但是对关键字执行此操作会得到这个结果

Searching for keywords
Reading https://pypi.python.org/simple/keywords/
Couldn't find index page for 'keywords' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading https://pypi.python.org/simple/
No local packages or download links found for keywords
error: Could not find suitable distribution for Requirement.parse('keywords')

非常感谢任何建议,因为我不是真正的程序员而是测试人员。 谢谢

【问题讨论】:

标签: python django robotframework selenium2library


【解决方案1】:

有一个预发布包,可以很好地与 Python 3.4,here 一起安装:

pip install --pre -U https://github.com/HelioGuilherme66/robotframework-selenium2library/archive/v1.8.0b3.tar.gz

Pull Request 正在等待合并。

【讨论】:

  • 我能够更新到 robotsframework 3、python 3 和上面的 Selenium2Library。确保它是 v1.8.0b3.tar.gz 版本,而不是网上流传的 ...0b1 版本。
【解决方案2】:

到目前为止,Selenium2Library 与 Python 3.5 不兼容。请改用 Python 2.7。

Issue for adding Python 3 support

【讨论】:

    猜你喜欢
    • 2020-04-13
    • 2020-02-17
    • 2021-06-04
    • 2019-01-28
    • 2017-03-30
    • 2016-09-20
    • 1970-01-01
    • 2017-04-16
    • 2014-11-04
    相关资源
    最近更新 更多