一直觉得SilkTest的ChildWin不好理解,今天大致看了一下,其实它和DialogBox每啥区别,也是一种window类型。帮助里面说,典型的ChildWin就是文档窗口。在Windows上, ChildWin是MDI (多文档接口multi-document interface)子窗口,可以在main window中被最大化,最小化,调整大小的窗口,一般地,childwin有一个系统菜单。
下面是一个打开silktest onlinehelp define window的例子,原来的 define window是DialogBox,现在把它改成childwin一样能够被silktest识别出来。(具体区别请对照上一篇 SilkTest天龙八部系列3-动态父窗口)
[+] testcase DynamicParent()
[ ] SilkTestHelp.SetActive()
[ ] SilkTestHelp.Bookmark.Define.Check()
[ ] sleep(1)
[ ] SilkTestHelp.bookmarkdefine.Close()
[ ] sleep(1)
[ ]
[+] window MainWin SilkTestHelp
[-] multitag “SilkTest Help”
[ ] “$C:/WINDOWS/winhlp32.exe”
[+] Menu File
[ ] tag “File”
[+] MenuItem Open
[+] multitag “Open”
[ ] “$1101”
[+] MenuItem PrintTopic
[+] multitag “Print Topic”
[ ] “$1103”
[+] MenuItem Exit
[+] multitag “Exit”
[ ] “$1105”
[+] Menu Edit
[ ] tag “Edit”
[+] MenuItem Copy
[+] multitag “Copy”
[ ] “$1203”
[+] MenuItem Annotate
[+] multitag “Annotate”
[ ] “$1202”
[+] Menu Bookmark
[ ] tag “Bookmark”
[+] MenuItem Define
[+] multitag “Define”
[ ] “$1301”
[+] Menu Options
[ ] tag “Options”
[+] Menu KeepHelpOnTop
[ ] tag “Keep Help on Top”
[+] MenuItem Default
[+] multitag “Default”
[ ] “$1470”
[+] MenuItem OnTop
[+] multitag “On Top”
[ ] “$1471”
[+] MenuItem NotOnTop
[+] multitag “Not On Top”
[ ] “$1472”
[+] MenuItem DisplayHistoryWindow
[+] multitag “Display History Window”
[ ] “$1453”
[+] Menu Font
[ ] tag “Font”
[+] MenuItem Small
[+] multitag “Small”
[ ] “$1462”
[+] MenuItem Normal
[+] multitag “Normal”
[ ] “$1460”
[+] MenuItem Large
[+] multitag “Large”
[ ] “$1461”
[+] MenuItem UseSystemColors
[+] multitag “Use System Colors”
[ ] “$1465”
[+] Menu Help
[ ] tag “Help”
[+] MenuItem Version
[+] multitag “Version”
[ ] “$1503”
[+] MenuItem AboutWinHelp2000
[+] multitag “About WinHelp 2000”
[ ] “$10001”
[+] CustomWin MS_WINTOPIC1
[ ] tag “[MS_WINTOPIC]$0”
[+] CustomWin MS_WINICON1
[ ] tag “[MS_WINICON]$0”
[+] PushButton HelpTopics
[+] multitag “Help Topics”
[ ] “$-1[1]”
[+] PushButton Back
[+] multitag “Back”
[ ] “$-1[2]”
[+] PushButton Print
[+] multitag “Print”
[ ] “$-1[3]”
[+] CustomWin Wh98NavPane1
[ ] tag “[Wh98NavPane]$999”
[+] CustomWin AfxWnd42s1
[ ] tag “[AfxWnd42s]$999[1]”
[+] PageList PageList1
[ ] tag “$998”
[+] StaticText StaticText1
[ ] tag “$65535”
[+] CustomWin Index
[+] multitag “[AfxWnd42s]Index”
[ ] “[AfxWnd42s]$999[2]”
[+] TextField TextField1
[ ] tag “$14003”
[+] TreeView TreeView1
[ ] tag “$14005”
[+] PushButton Display
[+] multitag “Display”
[ ] “$14004”
[ ] window bookmarkdefine = BookmarkDefine
[ ]
[ ]
[+] window ChildWin BookmarkDefine
[ ] tag “../Bookmark Define”
[+] StaticText BookmarkNameText
[+] multitag “Bookmark name:”
[ ] “$65535”
[+] TextField BookmarkName1
[+] multitag “Bookmark name:”
[ ] “$102”
[+] ListBox BookmarkName2
[+] multitag “Bookmark name:”
[ ] “$103”
[+] PushButton OK
[+] multitag “OK”
[ ] “$1”
[+] PushButton Cancel
[+] multitag “Cancel”
[ ] “$2”
[+] PushButton Delete
[+] multitag “Delete”
[ ] “$104”