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