一旦我的机器人测试之一失败,所有其他测试都失败了,我似乎无法找出原因。
我只是在设备上执行一个简单的nslookup,然后检查输出中是否包含单词“ Name:”
示例:
*** Settings ***
Library SSHLibrary
Suite Setup Open Connection And Log In
Suite Teardown Close All Connections
*** Variables ***
${HOST} localhost
${LOGIN} testUser
${PASSWORD} testUser
*** Keywords ***
Open Connection And Log In
Open Connection ${HOST}
Login ${LOGIN} ${PASSWORD}
*** Test Cases ***
resolve dns domain on google:
Write nslookup qsdf.ft 8.8.4.4
${output}= Read delay=0.5s
Should Contain ${output} Name:
resolve dns domain google.com:
Write nslookup google.com 8.8.4.4
${output}= Read delay=0.5s
Should Contain ${output} Name:
第一个测试应该失败,第二个测试应该通过。
第一个测试似乎仍在等待输出,而其他测试仍在继续
我在两个测试中的输出:
'' does not contain 'Name:'