Vantage 知識庫

VantageManager Telnet 腳本命令

腳本版本 1.1, 2019-04-20

腳本由許多行組成,這些行將按順序執行。
任何空行或以分號 “;” 開頭的行都將被忽略

 可能
- 用單 ' 或雙 “ 括起來的常量字串。可以插入特殊字元,例如 \n \t 等。示例“顯示版本”
- 先前分配的變數的變數識別元(請參閱下面的 set 命令)
-二  由 + 運算子分隔。示例 “abcd” + “def”
- 命令/函數的結果,定義如下。示例“結果為:” + 回復“>”
- 先前分配的變數的變數識別元(請參閱下面的 set 命令)

 可能
- 一個常量整數。示例 1、5。
- 先前分配的變數的變數識別元(請參閱下面的 set 命令)
-二  由 + 運算子分隔。例 3+7
- 帶有運算符“not”、“and”、“or”的布爾表達式。結果為 [] 的示例:不是 2 [0]、3 和 4 [1]
- 可以使用括弧。示例:(3 和 0)或 11 [1]
- 使用 == 或 != 運算符比較兩個整數或字串的結果。示例 “aa”==rectill “ >”, 2!=5
- 命令/函數的結果,定義如下。範例符合 “def”, “abcdef” [1]

命令/功能: 

發送 
通過遠端登錄將字串發送到 DUT
返回與發送的字串相同的字串。

森德倫 
通過遠端登錄向 DUT 發送後跟 CRLF 的字串
返回與發送的字串相同的字串。

退縮 
從 DUT 接收數據,直到它包含指定的字串
返回接收到的數據,但不包括字串。

雷克恩
從 DUT 接收數據,直到下一個 CRLF
返回接收到的數據,但不包括CRLF。

等 
等待指定的秒數
返回 1

失敗如果 
將中止腳本執行(以及測試執行),並顯示錯誤消息,如果  不是 0。
如果腳本未中止,則返回 0。如果中止,則不會返回。

。.log 
指定的表示式列印到 UI 上的測試紀錄(該紀錄也包含測試報告中 )
返回相同的字串。

火柴  , 
匹配兩個表達式。如果返回 1,則返回  包含在  否則為 0。
 可以是具有常用通配符、正則表達式語法等的正則表達式。

設置  = 
Assign the value to the variable specified which may be used in other expressions.
Returns the value of the expression.


Examples of scripts:


; script that will login to DUT
log "Login to DUT..."
log recuntil "login: "
sendln "admin"
recuntil "Password: "
sendln "12345"
recuntil " >"
log "Login successfull..."

; check if version of DUT is 5.2 as obtained by the system resource print command
sendln "system resource print"
log recuntil " >"
log recuntil " >"
set reply= recuntil " >"
log reply
failif not match "version: 5.2", reply
log "Version of DUT is correct ..."