AttributeError:“ NoneType”对象在机器人框架中没有属性“ decode”

时间:2020-11-10 08:18:04

标签: robotframework robotframework-sshlibrary

使用“ GetPreLoginBanner”关键字时,我遇到了错误消息

*** Settings ***
Library           SSHLibrary

Testcase
   ${RemoteServer}=    openconnection    127.0.0.1    port=2424    
    Login    ubuntu    ubuntu
    ${banner} =    GetPreLoginBanner    
    Log    ${banner}    

错误:

FAIL : AttributeError: 'NoneType' object has no attribute 'decode'
Traceback (most recent call last):
  File "c:\python27\lib\site-packages\SSHLibrary\library.py", line 1005, in get_pre_login_banner
    return banner.decode(self.DEFAULT_ENCODING)
Ending test:   Hits.Builtkeys.SSHLibrary.LoginBanner

有人可以帮助解决此错误。

1 个答案:

答案 0 :(得分:1)

这看起来像是SSHLibrary中的错误。假设banner是某种字符串,但是在这种特定情况下,它是None