zoukankan      html  css  js  c++  java
  • QTP取出WinListView中对象及子对象的属性

    昨天一位朋友问我如何取到搜狗音乐盒播放列表中歌曲的属性,我做了个小试验,将一些函数组合起来用,能够方便的取出WinListView中元素及子元素的属性。以下代码调试通过。

             ReDim Columns(10)
            Set ōbj = Window("搜狗音乐盒").WinListView("SysListView32")
            cColumns = Obj.ColumnCount()
            For iColumn = 0 To cColumns - 1
             Columns(iColumn) = Obj.GetColumnHeader(iColumn)
            Next
            cItems = Obj.GetItemsCount
            For iItems = 0 To cItems - 1
             str ="第 "&iItems+1&" 首歌曲属性列表"& vbCr
             For iColumn =0 To cColumns - 1
               str = str &Columns(iColumn)&" = "& Obj.GetSubItem(iItems ,Columns(iColumn)) & vbCr
             Next
             Msgbox str
            Next
            Set ōbj = nothing


            重要函数介绍:
            ColumnCount函数:Returns the number of columns in a (report-style) list-view control. -----返回list-view有多少栏位
            GetColumnHeader函数:Returns the text header of the specified (report-style) list-view column.-----返回list-view的栏位名
            GetItemsCount函数:Returns the number of items in the combo box list.-----返回list中元素个数
            GetSubItem函数:Returns the text value of a (report-style) list-view sub-item. -------返回list中子元素的栏位值

    来源 http:/ /softtest.chinaitlab.com/QTP/752224.html

  • 相关阅读:
    Spring-Task
    bootstrap table分页(前后端两种方式实现)
    jquery file upload示例
    ajax传递list集合
    cogs 2383. [Hnoi2014]世界树 WD
    cogs 36.求和问题
    bolg
    noip2016
    cogs 1619. [HEOI2012]采花 AC
    leetcode[109]Convert Sorted List to Binary Search Tree
  • 原文地址:https://www.cnblogs.com/emma/p/1677225.html
Copyright © 2011-2022 走看看