獲取注釋的父節點的類型和名稱 軟件測試
str = str + ftype1(name1)
str = str + "." + ftype2(name2)
.
.
.
str = str + "." + ftypeN(nameN)
獲取操作
op
str = str + "." + op
execute str
這樣就可以執行一個操作了。'可以定義操作
舉例說明
如掛失,找到"掛失",查找控件的位置不是最高節點,查找其與父節點的差值,得其有幾個父節點
父節點類型VbWindow,名稱Form1
str = VbWindow("Form1")
下一級父節點類型ActiveX,名稱CSCommand.Command
str = VbWindow("Form1").ActiveX("CSCommand.Command")
下一級父節點類型VbWindow,名稱SearchForm
str = VbWindow("Form1").ActiveX("CSCommand.Command").VbWindow("SearchForm")
下一級父節點類型ActiveX,名稱SSTab
str = VbWindow("Form1").ActiveX("CSCommand.Command").VbWindow("SearchForm").ActiveX("SSTab")
到了葉節點,類型ActiveX,名稱CSCommand.Command_11
str = VbWindow("Form1").ActiveX("CSCommand.Command").VbWindow("SearchForm").ActiveX("SSTab").ActiveX("CSCommand.Command_11")
所做操作,比如定義1為單擊,若為1
文章來源于領測軟件測試網 http://www.kjueaiud.com/