根据报错信息和红色显示,解决robotframework没有第三方库的问题


怎么知道报错是什么意思
No keyword with name 'Start Session' found
这个问题直接复制后百度得到这个网站
https://stackoverflow.com/questions/46974469/no-keyword-with-name-create-session-found-robot-framework
有一个答案是这个:

Looks like you're trying to use the requests library but haven't imported it. I recommend that you read the user guide, especially the part on importing libraries.

解决了request 库以后,发现这个答案只是误打误撞,安装了request库以后,还有别的问题。

pip install requests
第三方库的路径一般在site-packages下
C:\Python27\Lib\site-packages\requests
databaselibrary库的全称叫  robotframework-databaselibrary

pip install robotframework-databaselibrary

https://blog.csdn.net/zk65645/article/details/61195506 如果未来要装MySQL,这篇文章值得借鉴。

http://www.cnblogs.com/pachongshangdexuebi/category/981644.html Framework学习经验

安装完毕后,点击library输入库的名称,RIDE则会自动去python目录下去搜寻库,若是不存在或者库有错,导入则不成功,则显示红色。因为去搜索库所以有延迟。

----------------------

网上有一个方法,找不到路径的情况下可也以用这个方法。前提是要安装了这个库。

PYTHONPATH没有看到有RequestLibrary和requests库,你安装了吗?安装在哪个路径下了?

如果不是默认路径,可以在菜单-tools-Preferences-Importing-Pythonpath指定库所在路径。

一般默认路径在C盘下。

---------------------

这个requesetMsgJY.py的报错怎么解决呢,运行用例后得到报错信息。


要多点点,找到库在哪里设置。  这个多点点的方法也是误打误撞,F5可以看到所有的库。

这个也是幸运了一些知道在哪里配置。

但是,如果不知道在哪里配置,通过报错信息也可以看出来少了哪些库。


module在报错中的意义是库,属于电脑专业术语。.

No module named bs4  意思是缺少bs4库,天哪,谁知道有这个库。pip install bs4


一个用力会报很多错误,一定要从头看起,后面的错误,不要去看他,TMSS 不就是这样的吗。

[ ERROR ] Error in file 'D:\SVN\autosystem\trunk\cases\Resources\global_user_keyword.txt': Importing test library 'D:\SVN\autosystem\trunk\lib\common\GetFromMobilestock.py' failed: ImportError: No module named pytz
Traceback (most recent call last):
  File "D:\SVN\autosystem\trunk\lib\common\GetFromMobilestock.py", line 9, in <module>
    import time, pytz, datetime

-------------------------

Microsoft Windows [版本 6.1.7601]
版权所有 (c) 2009 Microsoft Corporation。保留所有权利。

D:\Users\k0100055>ride.py
FAILED D:\SVN\autosystem\trunk\cases\Resources\../../lib/common/Session.py Impor
ting test library 'D:\SVN\autosystem\trunk\cases\Resources\..\..\lib\common\Sess
ion.py' failed: ImportError: No module named bs4
Traceback (most recent call last):
  File "C:\Python27\lib\site-packages\robotide\lib\robot\utils\importer.py", lin
e 143, in _import
    return __import__(name, fromlist=fromlist)
  File "D:\SVN\autosystem\trunk\lib\common\Session.py", line 10, in <module>
    from bs4 import BeautifulSoup
PYTHONPATH:
  C:\Python27\lib\site-packages\robot\libraries
  C:\Python27\lib\site-packages
  C:\Python27\lib\site-packages\wx-2.8-msw-unicode
  C:\Python27\lib\site-packages\wx-2.8-msw-unicode
  C:\Python27\Scripts
  C:\Python27\python27.zip
  C:\Python27\DLLs
  C:\Python27\lib
  C:\Python27\lib\plat-win
  C:\Python27\lib\lib-tk
  C:\Python27
  C:\Python27\lib\site-packages\setuptools-38.5.2-py2.7.egg
  C:\Python27\lib\site-packages\robotide\spec
  .
FAILED D:\SVN\autosystem\trunk\cases\Resources\../../lib/common/Commons.py Impor
ting test library 'D:\SVN\autosystem\trunk\cases\Resources\..\..\lib\common\Comm
ons.py' failed: ImportError: No module named redis
Traceback (most recent call last):
  File "C:\Python27\lib\site-packages\robotide\lib\robot\utils\importer.py", lin
e 143, in _import
    return __import__(name, fromlist=fromlist)
  File "D:\SVN\autosystem\trunk\lib\common\Commons.py", line 10, in <module>
    import redis
PYTHONPATH:
  C:\Python27\lib\site-packages\robot\libraries
  C:\Python27\lib\site-packages
  C:\Python27\lib\site-packages\wx-2.8-msw-unicode
  C:\Python27\lib\site-packages\wx-2.8-msw-unicode
  C:\Python27\Scripts
  C:\Python27\python27.zip
  C:\Python27\DLLs
  C:\Python27\lib
  C:\Python27\lib\plat-win
  C:\Python27\lib\lib-tk
  C:\Python27
  C:\Python27\lib\site-packages\setuptools-38.5.2-py2.7.egg
  C:\Python27\lib\site-packages\robotide\spec
  .
FAILED D:\SVN\autosystem\trunk\cases\Resources\../../lib/common/Mobilestock.py I
mporting test library 'D:\SVN\autosystem\trunk\cases\Resources\..\..\lib\common\
Mobilestock.py' failed: ImportError: No module named bs4
Traceback (most recent call last):
  File "C:\Python27\lib\site-packages\robotide\lib\robot\utils\importer.py", lin
e 143, in _import
    return __import__(name, fromlist=fromlist)
  File "D:\SVN\autosystem\trunk\lib\common\Mobilestock.py", line 13, in <module>

    from bs4 import BeautifulSoup
PYTHONPATH:
  C:\Python27\lib\site-packages\robot\libraries
  C:\Python27\lib\site-packages
  C:\Python27\lib\site-packages\wx-2.8-msw-unicode
  C:\Python27\lib\site-packages\wx-2.8-msw-unicode
  C:\Python27\Scripts
  C:\Python27\python27.zip
  C:\Python27\DLLs
  C:\Python27\lib
  C:\Python27\lib\plat-win
  C:\Python27\lib\lib-tk
  C:\Python27
  C:\Python27\lib\site-packages\setuptools-38.5.2-py2.7.egg
  C:\Python27\lib\site-packages\robotide\spec
 
FAILED D:\SVN\autosystem\trunk\cases\Resources\../../lib/common/GetFromMobilesto
ck.py Importing test library 'D:\SVN\autosystem\trunk\cases\Resources\..\..\lib\
common\GetFromMobilestock.py' failed: ImportError: No module named bs4
Traceback (most recent call last):
  File "C:\Python27\lib\site-packages\robotide\lib\robot\utils\importer.py", lin
e 143, in _import
    return __import__(name, fromlist=fromlist)
  File "D:\SVN\autosystem\trunk\lib\common\GetFromMobilestock.py", line 8, in <m
odule>
    from Mobilestock import Mobilestock
  File "D:\SVN\autosystem\trunk\lib\common\Mobilestock.py", line 13, in <module>

    from bs4 import BeautifulSoup
PYTHONPATH:
  C:\Python27\lib\site-packages\robot\libraries
  C:\Python27\lib\site-packages
  C:\Python27\lib\site-packages\wx-2.8-msw-unicode
  C:\Python27\lib\site-packages\wx-2.8-msw-unicode
  C:\Python27\Scripts
  C:\Python27\python27.zip
  C:\Python27\DLLs
  C:\Python27\lib
  C:\Python27\lib\plat-win
  C:\Python27\lib\lib-tk
  C:\Python27
  C:\Python27\lib\site-packages\setuptools-38.5.2-py2.7.egg
  C:\Python27\lib\site-packages\robotide\spec




阅读更多
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭
关闭