QTP的那些事weblist中相关的内容获取

参考链接地址:http://www.learnqtp.com/forums/Thread-Verifying-the-contents-of-a-Web-List-in-QTP-scipt

有两种方法:

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

原文地址:https://www.cnblogs.com/seniortestingdev/p/2541661.html