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

posted @ 2012-06-08 13:25  高级测试开发网  阅读(1257)  评论(0编辑  收藏  举报
了解开发资源最新动态:https://seniortesting.club