[ ] Row[1] = "hello"
[ ] Print(Row[1] )
運行它你會得到一個*** Error: Type mismatch -- Expecting an INTEGER的錯誤。
但是如果你運行接下來這個非常類似的例子,卻不會有什么問題。
view plaincopy to clipboardprint?
01.[-] testcase anytype_list_mix()
02. [ ] list of ANYTYPE Row = {10, "world"}
03. [ ] Print(Row[1] )
04. [ ] Row[1] = "hello"
05. [ ] Print(Row[1] )
06. [ ] Row[2] = 20
07. [ ] Print(Row[2] )
[-] testcase anytype_list_mix()
[ ] list of ANYTYPE Row = {10, "world"}
[ ] Print(Row[1] )
[ ] Row[1] = "hello"
[ ] Print(Row[1] )
[ ] Row[2] = 20
[ ] Print(Row[2] )
所以我懷疑SilkTest會預先檢查list中元素的類型,如果所有元素都是一種類型,那么SilkTest自動認為該list是該類型
而非anytype.如果list中確實存在多種數據類型,那么SilkTest認為list的每個元素都是anytype的。
大家在編程的時候可能需要注意該問題。
文章來源于領測軟件測試網 http://www.kjueaiud.com/