参考链接地址:
有两种方法:
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 notCorrect 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