|
这事整愁了,我直接把帮助文档里的这段示例发给你吧
- Dim qtApp
- Dim qtIdent
- Dim qtWinListIdent
- Dim intPosition
- Set qtApp = CreateObject("QuickTest.Application")
- qtApp.Launch
- qtApp.Visible = True
- Set qtIdent = qtApp.Options.ObjectIdentification
- Set qtWinListIdent = qtIdent.Item("WinList")
- qtIdent.ResetAll
- qtWinListIdent.OrdinalIdentifier = "Index"
- intPosition = qtWinListIdent.MandatoryProperties.Find("nativeclass")
- qtWinListIdent.MandatoryProperties.Remove intPosition
- If qtWinListIdent.AvailableProperties.Find("items count") <> -1 Then
- qtWinListIdent.MandatoryProperties.Add "items count" '
- End If
- qtWinListIdent.AssistiveProperties.RemoveAll
- qtWinListIdent.AssistiveProperties.Add "all items"
- qtWinListIdent.AssistiveProperties.Add "width", 1
- qtWinListIdent.AssistiveProperties.Add "height", -1
- qtWinListIdent.AssistiveProperties.MoveToPos 2, 1
- qtWinListIdent.EnableSmartIdentification = True
- If qtWinListIdent.BaseFilterProperties.Count = 0 Then
- qtWinListIdent.BaseFilterProperties.Add "x"
- qtWinListIdent.BaseFilterProperties.Add "y"
- End If
- qtWinListIdent.OptionalFilterProperties.Add "abs_x", 1
- qtWinListIdent.OptionalFilterProperties.Add "abs_y", 2
- Set qtWinListIdent = Nothing
- Set qtIdent = Nothing
- Set qtApp = Nothing
-
复制代码 |
|