51Testing软件测试论坛

标题: SilkTest Tips(exchange) [打印本页]

作者: asks_zhuang    时间: 2006-10-18 22:24
标题: SilkTest Tips(exchange)
1.How can SilkTest check and uncheck CheckBoxes embedded into ListViews which are not recognised by the recorder?




ANSWER
----------------------------------


CheckBoxes embedded into ListView controls are not recognised by SilkTest at all. This is due to the fact that these controls are not true CheckBoxes and are simply icons which do not have a standard class in SilkTest.


These controls can be tested with SilkTest despite the recognition problem. One of the aspects which can be tested is checking and unchecking of the CheckBoxes.


The example below uses the network properties DialogBox on Windows as the AUT. This DialogBox contains a ListView with embedded CheckBoxes. The code uses PressItem(), ReleaseItem() and TypeKeys() to manipulate the CheckBoxes. The parameter passed to PressItem() and ReleaseItem() is the index of the item you wish to highlight in the ListView, the name of this item can also be used as an alternative to the index. TypeKeys("<Space>") performs the check or uncheck of the CheckBox.



        [ ] Window1.SetActive ()
        [ ] Window1.Dialog1.ListView1.PressItem (3)
        [ ] Window1.Dialog1.ListView1.ReleaseItem (3)
        [ ] Window1.Dialog1.ListView1.TypeKeys ("<Space>")
作者: cristal    时间: 2006-10-19 15:11
select 再 typekeys也可以吧
作者: ljustin    时间: 2006-10-19 18:21
thanks....looking forward to more tips.
作者: wwwalker    时间: 2006-10-27 09:23
用record 窗体的功能可以实现的




欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2