添加命令执行比对包含和不包含两类字符串关键字:SystemCommandReturnCompare
参数说明:要执行的系统命令 命令返回结果要包含的字符串列表 命令返回结果不能包含的字符串列表
This commit is contained in:
@@ -37,3 +37,27 @@ SystemCommand
|
||||
${rescode} Set Variable 200
|
||||
log ${rescode}
|
||||
[Return] ${rescode}
|
||||
|
||||
|
||||
SystemCommandReturnCompare
|
||||
#执行命令并比对命令返回结果 需要执行的系统命令 命令返回结果要包含的字符串列表 命令返回结果不能包含的字符串列表
|
||||
[Arguments] ${commandstr} ${stringlist} ${stringlistnotin}
|
||||
log toSystemCommand_SystemCommandTest
|
||||
${commandreturn} OperatingSystem.Run ${commandstr}
|
||||
Append To File ${path}/write_file.txt ${commandstr}
|
||||
Append To File ${path}/write_file.txt %%%%%%%%%%%%%%newbat
|
||||
Append To File ${path}/write_file.txt ${commandreturn}
|
||||
#${commandreturn} Set Variable abcdeConnection was reset
|
||||
${listlenth}= Get Length ${stringlist}
|
||||
FOR ${var} IN RANGE ${listlenth}
|
||||
log ${var}
|
||||
Should Contain ${commandreturn} ${stringlist}[${var}]
|
||||
END
|
||||
${listnotin}= Get Length ${stringlistnotin}
|
||||
FOR ${varn} IN RANGE ${listnotin}
|
||||
log ${varn}
|
||||
Should Not Contain ${commandreturn} ${stringlistnotin}[${varn}]
|
||||
END
|
||||
${rescode} Set Variable 200
|
||||
log ${rescode}
|
||||
[Return] ${rescode}
|
||||
|
||||
Reference in New Issue
Block a user