Jump to content

UIAAutomation of AFX:ToolBar control


Recommended Posts

I'm attempting to use UIAAutomation to auotmate an application that uses AFX toolbars.

Using _UIA_launchScript, I'm only able to focus on the toolbar, but having some difficulties (given the examples) to reach into the toolbar for the actual button:

...using this as the base:

_UIA_StartSUT("SUT4")

local $UID_MyApp[3][2] = [ _
["mainwindow","classname:=MyApp"], _
["AFXToolbar","class:=Afx:ToolBar:830000:8:10005:10; controltype:=50021"], _
["AFXToolbar_Button","title:=Track; controltype:=50011"] _
]
_UIA_setVarsFromArray($UID_MyApp,"MyApp.")

local $script[50][10]= [ _
["MyApp.mainwindow", "setfocus"], _
["MyApp.AFXToolbar", "setfocus"], _
["MyApp.AFXToolbar_Button","setfocus"] _
]

_UIA_launchScript($script)

it seems, conceptually, i'd have to do something like this:

local $script[50][10]= [ _
["MyApp.mainwindow", "setfocus"], _
["MyApp.AFXToolbar", "setfocus"], _
["AFXToolbar.AFXToolbar_Button","setfocus"] _
]


OR

local $script[50][10]= [ _
["MyApp.mainwindow", "setfocus"], _
["MyApp.AFXToolbar", "setfocus"], _
["MyApp.AFXToolbar.AFXToolbar_Button","setfocus"] _
]

But both of these cause script errors

output of spy tool on the specific button of the toolbar:

Mouse position is retrieved 630-86
At least we have an element [Track][]
Having the following values for all properties: 
Title is: <Track>   Class   := <>   controltype:= <UIA_MenuItemControlTypeId>   ,<50011>    , (0000C35B)    
*** Parent Information ***
Title is: <>    Class   := <Afx:ToolBar:830000:8:10005:10>  controltype:= <UIA_ToolBarControlTypeId>    ,<50021>    , (0000C365)    
*** Detailed properties of the highlighted element ***
UIA_AcceleratorKeyPropertyId :=
UIA_AccessKeyPropertyId :=
UIA_AriaPropertiesPropertyId :=
UIA_AriaRolePropertyId :=
UIA_AutomationIdPropertyId :=
UIA_BoundingRectanglePropertyId :=607;56;60;53
UIA_ClassNamePropertyId :=
UIA_ClickablePointPropertyId :=
UIA_ControllerForPropertyId :=
UIA_ControlTypePropertyId :=50011
UIA_CulturePropertyId :=0
UIA_DescribedByPropertyId :=
UIA_DockDockPositionPropertyId :=5
UIA_ExpandCollapseExpandCollapseStatePropertyId :=3
UIA_FlowsToPropertyId :=
UIA_FrameworkIdPropertyId :=
UIA_GridColumnCountPropertyId :=0
UIA_GridItemColumnPropertyId :=0
UIA_GridItemColumnSpanPropertyId :=1
UIA_GridItemContainingGridPropertyId :=
UIA_GridItemRowPropertyId :=0
UIA_GridItemRowSpanPropertyId :=1
UIA_GridRowCountPropertyId :=0
UIA_HasKeyboardFocusPropertyId :=True
UIA_HelpTextPropertyId :=CMFCToolBarMenuButton
UIA_IsContentElementPropertyId :=True
UIA_IsControlElementPropertyId :=True
UIA_IsDataValidForFormPropertyId :=False
UIA_IsDockPatternAvailablePropertyId :=False
UIA_IsEnabledPropertyId :=True
UIA_IsExpandCollapsePatternAvailablePropertyId :=False
UIA_IsGridItemPatternAvailablePropertyId :=False
UIA_IsGridPatternAvailablePropertyId :=False
UIA_IsInvokePatternAvailablePropertyId :=True
UIA_IsItemContainerPatternAvailablePropertyId :=False
UIA_IsKeyboardFocusablePropertyId :=True
UIA_IsLegacyIAccessiblePatternAvailablePropertyId :=True
UIA_IsMultipleViewPatternAvailablePropertyId :=False
UIA_IsOffscreenPropertyId :=False
UIA_IsPasswordPropertyId :=False
UIA_IsRangeValuePatternAvailablePropertyId :=False
UIA_IsRequiredForFormPropertyId :=False
UIA_IsScrollItemPatternAvailablePropertyId :=False
UIA_IsScrollPatternAvailablePropertyId :=False
UIA_IsSelectionItemPatternAvailablePropertyId :=False
UIA_IsSelectionPatternAvailablePropertyId :=False
UIA_IsSynchronizedInputPatternAvailablePropertyId :=False
UIA_IsTableItemPatternAvailablePropertyId :=False
UIA_IsTablePatternAvailablePropertyId :=False
UIA_IsTextPatternAvailablePropertyId :=False
UIA_IsTogglePatternAvailablePropertyId :=False
UIA_IsTransformPatternAvailablePropertyId :=False
UIA_IsValuePatternAvailablePropertyId :=False
UIA_IsVirtualizedItemPatternAvailablePropertyId :=False
UIA_IsWindowPatternAvailablePropertyId :=False
UIA_ItemStatusPropertyId :=
UIA_ItemTypePropertyId :=
UIA_LabeledByPropertyId :=
UIA_LegacyIAccessibleChildIdPropertyId :=5636726
UIA_LegacyIAccessibleDefaultActionPropertyId :=Open
UIA_LegacyIAccessibleDescriptionPropertyId :=Set tracking times for the selected exam
UIA_LegacyIAccessibleHelpPropertyId :=CMFCToolBarMenuButton
UIA_LegacyIAccessibleKeyboardShortcutPropertyId :=
UIA_LegacyIAccessibleNamePropertyId :=Track
UIA_LegacyIAccessibleRolePropertyId :=12
UIA_LegacyIAccessibleSelectionPropertyId :=
UIA_LegacyIAccessibleStatePropertyId :=1048580
UIA_LegacyIAccessibleValuePropertyId :=
UIA_LocalizedControlTypePropertyId :=menu item
UIA_MultipleViewCurrentViewPropertyId :=0
UIA_MultipleViewSupportedViewsPropertyId :=
UIA_NamePropertyId :=Track
UIA_NativeWindowHandlePropertyId :=0
UIA_OrientationPropertyId :=0
UIA_ProcessIdPropertyId :=3676
UIA_ProviderDescriptionPropertyId :=[pid:3676,hwnd:0x0 Main(parent link):Microsoft: MSAA Proxy (unmanaged:uiautomationcore.dll)]
UIA_RangeValueIsReadOnlyPropertyId :=True
UIA_RangeValueLargeChangePropertyId :=0
UIA_RangeValueMaximumPropertyId :=0
UIA_RangeValueMinimumPropertyId :=0
UIA_RangeValueSmallChangePropertyId :=0
UIA_RangeValueValuePropertyId :=0
UIA_RuntimeIdPropertyId :=
UIA_ScrollHorizontallyScrollablePropertyId :=False
UIA_ScrollHorizontalScrollPercentPropertyId :=0
UIA_ScrollHorizontalViewSizePropertyId :=100
UIA_ScrollVerticallyScrollablePropertyId :=False
UIA_ScrollVerticalScrollPercentPropertyId :=0
UIA_ScrollVerticalViewSizePropertyId :=100
UIA_SelectionCanSelectMultiplePropertyId :=False
UIA_SelectionIsSelectionRequiredPropertyId :=False
UIA_SelectionselectionPropertyId :=
UIA_SelectionItemIsSelectedPropertyId :=False
UIA_SelectionItemSelectionContainerPropertyId :=
UIA_TableColumnHeadersPropertyId :=
UIA_TableItemColumnHeaderItemsPropertyId :=
UIA_TableRowHeadersPropertyId :=
UIA_TableRowOrColumnMajorPropertyId :=2
UIA_TableItemRowHeaderItemsPropertyId :=
UIA_ToggleToggleStatePropertyId :=2
UIA_TransformCanMovePropertyId :=False
UIA_TransformCanResizePropertyId :=False
UIA_TransformCanRotatePropertyId :=False
UIA_ValueIsReadOnlyPropertyId :=True
UIA_ValueValuePropertyId :=
UIA_WindowCanMaximizePropertyId :=False
UIA_WindowCanMinimizePropertyId :=False
UIA_WindowIsModalPropertyId :=False
UIA_WindowIsTopmostPropertyId :=False
UIA_WindowWindowInteractionStatePropertyId :=0
UIA_WindowWindowVisualStatePropertyId :=0
Edited by jdelaney
IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
Link to comment
Share on other sites

  1. Download latest version. Output is not of latest simplespy
  2. Without giving the errors there is not much to say
  3. Conceptually its just a stringmapping thru arrays your 2nd example is right

 

 

Quickstart 

  • Start simplespy.au3
  • Hover your mouse over the element you want to handle
  • Press ctrl+w
  • Copy / paste the given source to a new AutoIT script
  • If you need help
    • ask for help in new thread in general support section and post
      • screenshot that shows your element is highlighted with simplespy
      • post output of simplespy with all properties
      • attached log.txt if available in your script directory
      • use allways contents of latest zip files which could be work in progress (WIP) zip
Edited by junkew
Link to comment
Share on other sites

Thanks.  New output from spy is below.

I ran the script provided in the output, and added a _UIA_getAllPropertyValues

The actual click is dead center of $op2, and all the properties of my actual button are:

#include "UIAWrappers.au3"
AutoItSetOption("MustDeclareVars", 1)


Local $oP2=_UIA_getObjectByFindAll($UIA_oDesktop, "Title:=MyTitle;controltype:=UIA_WindowControlTypeId;class:=MyApp", $treescope_children)
_UIA_Action($oP2,"setfocus")
Local $oP1=_UIA_getObjectByFindAll($oP2, "Title:=;controltype:=UIA_PaneControlTypeId;class:=Afx:DockPane:830000:8:10005:10", $treescope_children)
_UIA_Action($oP1,"setfocus")
Local $oP0=_UIA_getObjectByFindAll($oP1, "Title:=;controltype:=UIA_ToolBarControlTypeId;class:=Afx:ToolBar:830000:8:10005:10", $treescope_children)
_UIA_Action($oP0,"setfocus")
;~ First find the object in the parent before you can do something
;~$oUIElement=_UIA_getObjectByFindAll("Track.mainwindow", "title:=Track;ControlType:=UIA_MenuItemControlTypeId", $treescope_subtree)
Local $oUIElement=_UIA_getObjectByFindAll($oP0, "title:=Track;ControlType:=UIA_MenuItemControlTypeId", $treescope_subtree)

_UIA_action($oUIElement,"click")

Local $s =_UIA_getAllPropertyValues($oUIElement)
ConsoleWrite($s & @CRLF)

UIA_title:= <** NO PROPERTYVALUE DUE TO NONEXISTING OBJECT **>

When I do the same output for Afx:Toolbar, it's all fine...not sure what else I can attempt.

 

full objectspy output:

Mouse position is retrieved 630-82
At least we have an element [Track][]
Having the following values for all properties: 
Title is: <Track>   Class   := <>   controltype:= <UIA_MenuItemControlTypeId>   ,<50011>    , (0000C35B)    607;56;60;53
*** Parent Information top down ***
3: Title is: <Desktop>  Class   := <#32769> controltype:= <UIA_PaneControlTypeId>   ,<50033>    , (0000C371)    0;0;1920;1080
"Title:=Desktop;controltype:=UIA_PaneControlTypeId;class:=#32769"   
2: Title is: <MyTitle>  Class   := <MyApp>  controltype:= <UIA_WindowControlTypeId> ,<50032>    , (0000C370)    0;0;995;900
"Title:=MyTitle;controltype:=UIA_WindowControlTypeId;class:=MyApp"  
1: Title is: <> Class   := <Afx:DockPane:830000:8:10005:10> controltype:= <UIA_PaneControlTypeId>   ,<50033>    , (0000C371)    8;30;979;81
"Title:=;controltype:=UIA_PaneControlTypeId;class:=Afx:DockPane:830000:8:10005:10"  
0: Title is: <> Class   := <Afx:ToolBar:830000:8:10005:10>  controltype:= <UIA_ToolBarControlTypeId>    ,<50021>    , (0000C365)    8;54;733;57
"Title:=;controltype:=UIA_ToolBarControlTypeId;class:=Afx:ToolBar:830000:8:10005:10"    
*** Standard code ***
#include "UIAWrappers.au3"
AutoItSetOption("MustDeclareVars", 1)

Local $oP2=_UIA_getObjectByFindAll($UIA_oDesktop, "Title:=MyTitle;controltype:=UIA_WindowControlTypeId;class:=MyApp", $treescope_children)  
_UIA_Action($oP2,"setfocus")
Local $oP1=_UIA_getObjectByFindAll($oP2, "Title:=;controltype:=UIA_PaneControlTypeId;class:=Afx:DockPane:830000:8:10005:10", $treescope_children)   
_UIA_Action($oP1,"setfocus")
Local $oP0=_UIA_getObjectByFindAll($oP1, "Title:=;controltype:=UIA_ToolBarControlTypeId;class:=Afx:ToolBar:830000:8:10005:10", $treescope_children) 
_UIA_Action($oP0,"setfocus")
;~ First find the object in the parent before you can do something
;~$oUIElement=_UIA_getObjectByFindAll("Track.mainwindow", "title:=Track;ControlType:=UIA_MenuItemControlTypeId", $treescope_subtree)
Local $oUIElement=_UIA_getObjectByFindAll($oP0, "title:=Track;ControlType:=UIA_MenuItemControlTypeId", $treescope_subtree)
_UIA_action($oUIElement,"click")
*** Detailed properties of the highlighted element ***
UIA_title:= <Track>
UIA_iaccessiblechildId:= <5374582>
UIA_BoundingRectangle:= <607;56;60;53>
UIA_ProcessId:= <3676>
UIA_ControlType:= <50011>
UIA_LocalizedControlType:= <menu item>
UIA_Name:= <Track>
UIA_HasKeyboardFocus:= <True>
UIA_IsKeyboardFocusable:= <True>
UIA_IsEnabled:= <True>
UIA_HelpText:= <CMFCToolBarMenuButton>
UIA_Culture:= <0>
UIA_IsControlElement:= <True>
UIA_IsContentElement:= <True>
UIA_IsPassword:= <False>
UIA_NativeWindowHandle:= <0>
UIA_IsOffscreen:= <False>
UIA_Orientation:= <0>
UIA_IsRequiredForForm:= <False>
UIA_IsDockPatternAvailable:= <False>
UIA_IsExpandCollapsePatternAvailable:= <False>
UIA_IsGridItemPatternAvailable:= <False>
UIA_IsGridPatternAvailable:= <False>
UIA_IsInvokePatternAvailable:= <True>
UIA_IsMultipleViewPatternAvailable:= <False>
UIA_IsRangeValuePatternAvailable:= <False>
UIA_IsScrollPatternAvailable:= <False>
UIA_IsScrollItemPatternAvailable:= <False>
UIA_IsSelectionItemPatternAvailable:= <False>
UIA_IsSelectionPatternAvailable:= <False>
UIA_IsTablePatternAvailable:= <False>
UIA_IsTableItemPatternAvailable:= <False>
UIA_IsTextPatternAvailable:= <False>
UIA_IsTogglePatternAvailable:= <False>
UIA_IsTransformPatternAvailable:= <False>
UIA_IsValuePatternAvailable:= <False>
UIA_IsWindowPatternAvailable:= <False>
UIA_ValueIsReadOnly:= <True>
UIA_RangeValueValue:= <0>
UIA_RangeValueIsReadOnly:= <True>
UIA_RangeValueMinimum:= <0>
UIA_RangeValueMaximum:= <0>
UIA_RangeValueLargeChange:= <0>
UIA_RangeValueSmallChange:= <0>
UIA_ScrollHorizontalScrollPercent:= <0>
UIA_ScrollHorizontalViewSize:= <100>
UIA_ScrollVerticalScrollPercent:= <0>
UIA_ScrollVerticalViewSize:= <100>
UIA_ScrollHorizontallyScrollable:= <False>
UIA_ScrollVerticallyScrollable:= <False>
UIA_SelectionCanSelectMultiple:= <False>
UIA_SelectionIsSelectionRequired:= <False>
UIA_GridRowCount:= <0>
UIA_GridColumnCount:= <0>
UIA_GridItemRow:= <0>
UIA_GridItemColumn:= <0>
UIA_GridItemRowSpan:= <1>
UIA_GridItemColumnSpan:= <1>
UIA_DockDockPosition:= <5>
UIA_ExpandCollapseExpandCollapseState:= <3>
UIA_MultipleViewCurrentView:= <0>
UIA_WindowCanMaximize:= <False>
UIA_WindowCanMinimize:= <False>
UIA_WindowWindowVisualState:= <0>
UIA_WindowWindowInteractionState:= <0>
UIA_WindowIsModal:= <False>
UIA_WindowIsTopmost:= <False>
UIA_SelectionItemIsSelected:= <False>
UIA_TableRowOrColumnMajor:= <2>
UIA_ToggleToggleState:= <2>
UIA_TransformCanMove:= <False>
UIA_TransformCanResize:= <False>
UIA_TransformCanRotate:= <False>
UIA_IsLegacyIAccessiblePatternAvailable:= <True>
UIA_LegacyIAccessibleChildId:= <5374582>
UIA_LegacyIAccessibleName:= <Track>
UIA_LegacyIAccessibleDescription:= <Set tracking times for the selected exam>
UIA_LegacyIAccessibleRole:= <12>
UIA_LegacyIAccessibleState:= <1048580>
UIA_LegacyIAccessibleHelp:= <CMFCToolBarMenuButton>
UIA_LegacyIAccessibleDefaultAction:= <Open>
UIA_IsDataValidForForm:= <False>
UIA_ProviderDescription:= <[pid:3676,hwnd:0x0 Main(parent link):Microsoft: MSAA Proxy (unmanaged:uiautomationcore.dll)]>
UIA_IsItemContainerPatternAvailable:= <False>
UIA_IsVirtualizedItemPatternAvailable:= <False>
UIA_IsSynchronizedInputPatternAvailable:= <False>

log file output

20140821-184030495 _UIA_getObjectByFindAll Title:=AppTitle;controltype:=UIA_WindowControlTypeId;class:=MyApp3
20140821-184030500   _UIA_getObjectByFindAll Title:=AppTitle
20140821-184030506   adding index 0 name:Title value:AppTitle
20140821-184030511   _UIA_getObjectByFindAll controltype:=UIA_WindowControlTypeId
20140821-184030519   adding index 7 name:controltype value:50032
20140821-184030524   _UIA_getObjectByFindAll class:=MyApp
20140821-184030529   adding index 1 name:class value:MyApp
20140821-184030975         j:0[30005][AppTitle][J:\Xfer\Justin\UIA_Automation\uiaTest.au3 - SciTE [13 of 13]]0
20140821-184030989         j:0[30005][AppTitle][J:\Xfer\Justin\UIA_Automation]0
20140821-184030995         j:0[30005][AppTitle][UIAAutomation of AFX:ToolBar control - General Help and Support - AutoIt Forums - Internet Explorer, optimized for Bing and MSN]0
20140821-184031006         j:0[30005][AppTitle][log.txt - Notepad]0
20140821-184031014         j:0[30005][AppTitle][AppTitle]1
20140821-184031032         j:1[30003][50032][50032]1
20140821-184031037         j:2[30012][MyApp][MyApp]1
20140821-184031045 Storing parent for found object in RTI as RTI.PARENT
20140821-184031068 Action 1 setfocus on  isobject:=1
20140821-184031074 reaching setfocus
20140821-184031086 Title is: <AppTitle> Class   := <MyApp>  controltype:= <UIA_WindowControlTypeId> ,<50032>    , (0000C370)    , acceleratorkey:= <>   , automationid:= <> 
20140821-184031298 _UIA_getObjectByFindAll Title:=;controltype:=UIA_PaneControlTypeId;class:=Afx:DockPane:830000:8:10005:103
20140821-184031320   _UIA_getObjectByFindAll Title:=
20140821-184031324   adding index 0 name:Title value:
20140821-184031334   _UIA_getObjectByFindAll controltype:=UIA_PaneControlTypeId
20140821-184031339   adding index 7 name:controltype value:50033
20140821-184031342   _UIA_getObjectByFindAll class:=Afx:DockPane:830000:8:10005:10
20140821-184031346   adding index 1 name:class value:Afx:DockPane:830000:8:10005:10
20140821-184031425         j:0[30005][][Workspace]1
20140821-184031443         j:1[30003][50033][50033]1
20140821-184031454         j:2[30012][Afx:DockPane:830000:8:10005:10][MDIClient]0
20140821-184031461         j:1[30003][50033][50033]1
20140821-184031465         j:2[30012][Afx:DockPane:830000:8:10005:10][Afx:DockPane:830000:8:10005:10]1
20140821-184031478 Storing parent for found object in RTI as RTI.PARENT
20140821-184031491 Action 2 setfocus on  isobject:=1
20140821-184031496 reaching setfocus
20140821-184031526 Title is: <> Class   := <Afx:DockPane:830000:8:10005:10> controltype:= <UIA_PaneControlTypeId>   ,<50033>    , (0000C371)    , acceleratorkey:= <>   , automationid:= <59419>    
20140821-184031753 _UIA_getObjectByFindAll Title:=;controltype:=UIA_ToolBarControlTypeId;class:=Afx:ToolBar:830000:8:10005:103
20140821-184031759   _UIA_getObjectByFindAll Title:=
20140821-184031764   adding index 0 name:Title value:
20140821-184031775   _UIA_getObjectByFindAll controltype:=UIA_ToolBarControlTypeId
20140821-184031783   adding index 7 name:controltype value:50021
20140821-184031788   _UIA_getObjectByFindAll class:=Afx:ToolBar:830000:8:10005:10
20140821-184031799   adding index 1 name:class value:Afx:ToolBar:830000:8:10005:10
20140821-184031856         j:1[30003][50021][50021]1
20140821-184031880         j:2[30012][Afx:ToolBar:830000:8:10005:10][Afx:ToolBar:830000:8:10005:10]1
20140821-184031902 Storing parent for found object in RTI as RTI.PARENT
20140821-184031916 Action 3 setfocus on  isobject:=1
20140821-184031926 reaching setfocus
20140821-184031945 Title is: <> Class   := <Afx:ToolBar:830000:8:10005:10>  controltype:= <UIA_ToolBarControlTypeId>    ,<50021>    , (0000C365)    , acceleratorkey:= <>   , automationid:= <59399>    
20140821-184032164 _UIA_getObjectByFindAll title:=Track;ControlType:=UIA_MenuItemControlTypeId2
20140821-184032170   _UIA_getObjectByFindAll title:=Track
20140821-184032180   adding index 0 name:title value:Track
20140821-184032192   _UIA_getObjectByFindAll ControlType:=UIA_MenuItemControlTypeId
20140821-184032198   adding index 7 name:ControlType value:50011
20140821-184032229 ***** Dumping tree *****
20140821-184032269 Title is: <> Class   := <Afx:ToolBar:830000:8:10005:10>  controltype:= <UIA_ToolBarControlTypeId>    ,<50021>    , (0000C365)    , acceleratorkey:= <>   , automationid:= <59399>    
20140821-184032274 _UIA_action: Finding object 
20140821-184032284 _UIA_action: No RTI.SEARCHCONTEXT used for 
20140821-184032289 _UIA_action: try for RTI.MAINWINDOW
20140821-184032298 _UIA_action: No RTI.MAINWINDOW used for 
20140821-184032302 6
20140821-184032317 [Global.Debug]:=[True]0
20140821-184032329 [Global.Debug.File]:=[True]0
20140821-184032334 [Global.Highlight]:=[True]0
20140821-184032338 [DESKTOP]:=[]1
20140821-184032346 [RTI.PARENT]:=[]1
20140821-184032351 [RTI.LASTELEMENT]:=[]1
20140821-184032360 [RTI.ACTIONCOUNT]:=[3]0
20140821-184032365 _UIA_action: Finding object  under RTI.PARENT
20140821-184032370 find 2 
20140821-184032377 _UIA_getObjectByFindAll 1
20140821-184032402   _UIA_getObjectByFindAll 
20140821-184032543 Storing parent for found object in RTI as RTI.PARENT
20140821-184032562 Action 4 setfocus on  isobject:=1
20140821-184032574 reaching setfocus
20140821-184032585 Title is: <> Class   := <Afx:DockPane:830000:8:10005:10> controltype:= <UIA_PaneControlTypeId>   ,<50033>    , (0000C371)    , acceleratorkey:= <>   , automationid:= <59419>    
20140821-184032808 _UIA_action: Finding object 
20140821-184032818 _UIA_action: No RTI.SEARCHCONTEXT used for 
20140821-184032823 _UIA_action: try for RTI.MAINWINDOW
20140821-184032828 _UIA_action: No RTI.MAINWINDOW used for 
20140821-184032837 6
20140821-184032842 [Global.Debug]:=[True]0
20140821-184032852 [Global.Debug.File]:=[True]0
20140821-184032857 [Global.Highlight]:=[True]0
20140821-184032865 [DESKTOP]:=[]1
20140821-184032874 [RTI.PARENT]:=[]1
20140821-184032881 [RTI.LASTELEMENT]:=[]1
20140821-184032885 [RTI.ACTIONCOUNT]:=[4]0
20140821-184032891 _UIA_action: Finding object  under RTI.PARENT
20140821-184032897 find 2 
20140821-184032903 _UIA_getObjectByFindAll 1
20140821-184032908   _UIA_getObjectByFindAll 
20140821-184033140         j:0[30005][][AppTitle]1
20140821-184033155 Storing parent for found object in RTI as RTI.PARENT
20140821-184033178 Action 5 click on  isobject:=1
20140821-184040457 _UIA_getObjectByFindAll Title:=AppTitle;controltype:=UIA_WindowControlTypeId;class:=MyApp3
20140821-184040464   _UIA_getObjectByFindAll Title:=AppTitle
20140821-184040468   adding index 0 name:Title value:AppTitle
20140821-184040473   _UIA_getObjectByFindAll controltype:=UIA_WindowControlTypeId
20140821-184040478   adding index 7 name:controltype value:50032
20140821-184040482   _UIA_getObjectByFindAll class:=MyApp
20140821-184040487   adding index 1 name:class value:MyApp
20140821-184041176         j:0[30005][AppTitle][J:\Xfer\Justin\UIA_Automation\uiaTest.au3 - SciTE [13 of 13]]0
20140821-184041184         j:0[30005][AppTitle][AppTitle]1
20140821-184041195         j:1[30003][50032][50032]1
20140821-184041200         j:2[30012][MyApp][MyApp]1
20140821-184041213 Storing parent for found object in RTI as RTI.PARENT
20140821-184041253 Action 1 setfocus on  isobject:=1
20140821-184041259 reaching setfocus
20140821-184041266 Title is: <AppTitle> Class   := <MyApp>  controltype:= <UIA_WindowControlTypeId> ,<50032>    , (0000C370)    , acceleratorkey:= <>   , automationid:= <> 
20140821-184041478 _UIA_getObjectByFindAll Title:=;controltype:=UIA_PaneControlTypeId;class:=Afx:DockPane:830000:8:10005:103
20140821-184041482   _UIA_getObjectByFindAll Title:=
20140821-184041493   adding index 0 name:Title value:
20140821-184041503   _UIA_getObjectByFindAll controltype:=UIA_PaneControlTypeId
20140821-184041507   adding index 7 name:controltype value:50033
20140821-184041511   _UIA_getObjectByFindAll class:=Afx:DockPane:830000:8:10005:10
20140821-184041522   adding index 1 name:class value:Afx:DockPane:830000:8:10005:10
20140821-184041566         j:0[30005][][Workspace]1
20140821-184041572         j:1[30003][50033][50033]1
20140821-184041581         j:2[30012][Afx:DockPane:830000:8:10005:10][MDIClient]0
20140821-184041594         j:1[30003][50033][50033]1
20140821-184041600         j:2[30012][Afx:DockPane:830000:8:10005:10][Afx:DockPane:830000:8:10005:10]1
20140821-184041612 Storing parent for found object in RTI as RTI.PARENT
20140821-184041617 Action 2 setfocus on  isobject:=1
20140821-184041632 reaching setfocus
20140821-184041644 Title is: <> Class   := <Afx:DockPane:830000:8:10005:10> controltype:= <UIA_PaneControlTypeId>   ,<50033>    , (0000C371)    , acceleratorkey:= <>   , automationid:= <59419>    
20140821-184041859 _UIA_getObjectByFindAll Title:=;controltype:=UIA_ToolBarControlTypeId;class:=Afx:ToolBar:830000:8:10005:103
20140821-184041864   _UIA_getObjectByFindAll Title:=
20140821-184041870   adding index 0 name:Title value:
20140821-184041881   _UIA_getObjectByFindAll controltype:=UIA_ToolBarControlTypeId
20140821-184041886   adding index 7 name:controltype value:50021
20140821-184041896   _UIA_getObjectByFindAll class:=Afx:ToolBar:830000:8:10005:10
20140821-184041900   adding index 1 name:class value:Afx:ToolBar:830000:8:10005:10
20140821-184041969         j:1[30003][50021][50021]1
20140821-184041975         j:2[30012][Afx:ToolBar:830000:8:10005:10][Afx:ToolBar:830000:8:10005:10]1
20140821-184041988 Storing parent for found object in RTI as RTI.PARENT
20140821-184041994 Action 3 setfocus on  isobject:=1
20140821-184042005 reaching setfocus
20140821-184042011 Title is: <> Class   := <Afx:ToolBar:830000:8:10005:10>  controltype:= <UIA_ToolBarControlTypeId>    ,<50021>    , (0000C365)    , acceleratorkey:= <>   , automationid:= <59399>    
20140821-184042233 _UIA_getObjectByFindAll title:=Track;ControlType:=UIA_MenuItemControlTypeId2
20140821-184042238   _UIA_getObjectByFindAll title:=Track
20140821-184042243   adding index 0 name:title value:Track
20140821-184042247   _UIA_getObjectByFindAll ControlType:=UIA_MenuItemControlTypeId
20140821-184042257   adding index 7 name:ControlType value:50011
20140821-184042290 ***** Dumping tree *****
20140821-184042330 Title is: <> Class   := <Afx:ToolBar:830000:8:10005:10>  controltype:= <UIA_ToolBarControlTypeId>    ,<50021>    , (0000C365)    , acceleratorkey:= <>   , automationid:= <59399>    
20140821-184042337 _UIA_action: Finding object 
20140821-184042348 _UIA_action: No RTI.SEARCHCONTEXT used for 
20140821-184042353 _UIA_action: try for RTI.MAINWINDOW
20140821-184042360 _UIA_action: No RTI.MAINWINDOW used for 
20140821-184042366 6
20140821-184042372 [Global.Debug]:=[True]0
20140821-184042384 [Global.Debug.File]:=[True]0
20140821-184042389 [Global.Highlight]:=[True]0
20140821-184042397 [DESKTOP]:=[]1
20140821-184042406 [RTI.PARENT]:=[]1
20140821-184042413 [RTI.LASTELEMENT]:=[]1
20140821-184042430 [RTI.ACTIONCOUNT]:=[3]0
20140821-184042435 _UIA_action: Finding object  under RTI.PARENT
20140821-184042442 find 2 
20140821-184042447 _UIA_getObjectByFindAll 1
20140821-184042458   _UIA_getObjectByFindAll 
20140821-184042558 Storing parent for found object in RTI as RTI.PARENT
20140821-184042569 Action 4 click on  isobject:=1
Edited by jdelaney
IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
Link to comment
Share on other sites

Sorry, unfortunately you are hitting in area in the framework which is not completely working that tries to dynamically find the contextarea in which part of the tree you want to search.

I can see you reach the toolbar itself

20140821-184041975         j:2[30012][Afx:ToolBar:830000:8:10005:10][Afx:ToolBar:830000:8:10005:10]1
20140821-184041988 Storing parent for found object in RTI as RTI.PARENT
 

 You can force the framework to use a certain range in the hierarchy by setting explicitly the RTI.SEARCHCONTEXT variable

20140821-184042348 _UIA_action: No RTI.SEARCHCONTEXT used for

 

Look in UIAWrappers for searchcontext to see the moment(s) its used and you can force it in the main script (do not forget to clear it later otherwise it will stay using the context requested)

Local $oP0=_UIA_getObjectByFindAll($oP1, "Title:=;controltype:=UIA_ToolBarControlTypeId;class:=Afx:ToolBar:830000:8:10005:10", $treescope_children)
_UIA_Action($oP0,"setfocus")

_UIA_setVar("RTI.SEARCHCONTEXT", $oP0)

and you can also do it with something like

_UIA_action(<yourobjectreference>,"context")

Not sure about exact syntax (no acces to the uiawrappers source at the moment)
 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...