QTP的那些事--采用DOM,描述性编程获取指定的对象


testrow=Browser("testip").Page("【testpage").Frame("mainFrame0_2").WebTable("testtable").GetRowWithCellText("a111230122")
print "order list id"&cstr(testrow)
Set des=description.Create()
des("micclass").value="WebButton"
'des("xpath").value="/html/body/div/div[2]/div[3]/table/tbody/tr[2]/td[11]/input"
set alist=Browser("testip").Page("【testpage").ChildObjects(des)

b=alist.count
print b
counted=0
For i=0 to b-1
     If alist(i).getroproperty("value")="购买" then 
         counted=counted+1
         If counted=(testrow-2) Then
             alist(i).click
         End If
    '     print "test id:"&cstr(counted)

    end if
Next






















posted @ 2011-12-30 21:12  高级测试开发网  阅读(434)  评论(0编辑  收藏  举报
了解开发资源最新动态:https://seniortesting.club