我正在使用telnet连接网络交换机,请参阅下面的脚本。在执行用户名命令时,此脚本在运行80-90次迭代后仍显示"EOFError:远程登录连接已关闭“错误消息。我在谷歌上搜索,试图找到根本原因,不幸的是,没有成功。如果您能指导我解决这个问题,我将不胜感激:
*** Settings ***
Library Telnet
*** keyword ***
Telnet Connection
Telnet.Open Connection ${IP} prompt=$
Telnet.Set Prompt (>|#|> |# |:|Password:| |) prompt_is_regexp=true
Telnet.Execute Command username
Telnet.Execute Command password
Telnet.Execute Command show something
sleep 2s
Telnet.read
Telnet.Execute Command exit
sleep 2s
Telnet.read
*** Test Cases ***
Telnet Connection
:FOR ${I} IN RANGE 0 10000
\ Telnet Connection发布于 2020-01-09 14:28:28
使用登录关键字进行连接:https://robotframework.org/robotframework/latest/libraries/Telnet.html#Login
还可以查看:https://robotframework.org/robotframework/latest/libraries/Telnet.html#Connections
您还可以从Execute Command获取返回值,并使用log To Console关键字将其记录在屏幕上。
https://stackoverflow.com/questions/59657893
复制相似问题