·有两种方法:
listval = browser("name").Page("name).WebList("name").GetROProperty("all items")
listvalues = split(listval,";") ' u ll get all weblist values in listvalues array.
use this aray and check whether ur item is thr in the list or not
Correct if m wrong. even i am new to QTP.
第二种方法:
xpected_Item="ABC"
Items_count=Browser("....").Page(".....").WebList("select").GetROProperty("Items Count")
For i=1 to Items_count
Current_Item=Browser("....").Page(".....").WebList("select").GetItem(i)
msgbox Current_Item
If Current_Item=Expected_Item Then
msgbox "expected item exists in WebList"
Browser("....").Page(".....").WebList("select").Select Expected_Item
Exit for
End If
Next
作者:高级测试开发网·
本文版权归作者·有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。