JNutt Posted April 3, 2018 Share Posted April 3, 2018 I'm trying to use control click in a script to click on a tab in a windows desktop app. I get the following info about the tab from simplyspy. How do I use the simply spy info? If I uncomment out the different _UIAM_Actions for oP(1-3) for highlighting (one at a time), then run the code nothing happens. At least we have an element title: [Project] class: [] Having the following values for all properties: Title is: <Project> Class := <> controltype:= <UIA_TabItemControlTypeId> ,<50019> , (0000C363) 58;30;68;25 *** Parent Information top down *** 2: Title is: <Innovaya Studio with Sage (Archtectural 2017_V1.invx)> Class := <WindowsForms10.Window.8.app.0.1e84ccb_r16_ad1> controltype:= <UIA_WindowControlTypeId> ,<50032> , (0000C370) -8;-8;1616;876 "Title:=Innovaya Studio with Sage (Archtectural 2017_V1.invx);controltype:=UIA_WindowControlTypeId;class:=WindowsForms10.Window.8.app.0.1e84ccb_r16_ad1"" 1: Title is: <The Ribbon> Class := <WindowsForms10.Window.8.app.0.1e84ccb_r16_ad1> controltype:= <UIA_PaneControlTypeId> ,<50033> , (0000C371) 0;-8;1600;157 "Title:=The Ribbon;controltype:=UIA_PaneControlTypeId;class:=WindowsForms10.Window.8.app.0.1e84ccb_r16_ad1"" 0: Title is: <Ribbon Tabs> Class := <> controltype:= <UIA_TabControlTypeId> ,<50018> , (0000C362) 0;30;1600;25 "Title:=Ribbon Tabs;controltype:=UIA_TabControlTypeId;class:="" ;~ *** Standard code maintainable *** #include "UIAWrappers.au3" AutoItSetOption("MustDeclareVars", 1) _UIA_setVar("oP1","Title:=Innovaya Studio with Sage (Archtectural 2017_V1.invx);controltype:=UIA_WindowControlTypeId;class:=WindowsForms10.Window.8.app.0.1e84ccb_r16_ad1") ;Innovaya Studio with Sage (Archtectural 2017_V1.invx) _UIA_setVar("oP2","Title:=The Ribbon;controltype:=UIA_PaneControlTypeId;class:=WindowsForms10.Window.8.app.0.1e84ccb_r16_ad1") ;The Ribbon _UIA_setVar("oP3","Title:=Ribbon Tabs;controltype:=UIA_TabControlTypeId;class:=") ;Ribbon Tabs ;~ $oUIElement=_UIA_getObjectByFindAll("Project.mainwindow", "title:=Project;ControlType:=UIA_TabItemControlTypeId", $treescope_subtree) _UIA_setVar("oUIElement","Title:=Project;controltype:=UIA_TabItemControlTypeId;class:=") ;ControlType:=UIA_TabItemControlTypeId;classname:=") ;~ Actions split away from logical/technical definition above can come from configfiles ;~_UIA_Action("oP1","highlight") _UIA_Action("oP1","setfocus") ;~_UIA_Action("oP2","highlight") _UIA_Action("oP2","setfocus") ;~_UIA_Action("oP3","highlight") _UIA_Action("oP3","setfocus") _UIA_action("oUIElement","highlight") ;~_UIA_action("oUIElement","click") Link to comment Share on other sites More sharing options...
JNutt Posted April 3, 2018 Author Share Posted April 3, 2018 Heres info from inspect.exe expandcollapse popupHow found: Mouse move (94,35) hwnd=0x0000000000010CCC 32bit class="WindowsForms10.Window.8.app.0.1e84ccb_r16_ad1" style=0x56000000 ex=0x0 BoundingRectangle: {l:58 t:30 r:126 b:55} ProcessId: 10256 ControlType: UIA_TabItemControlTypeId (0xC363) LocalizedControlType: "tab item" Name: "Project" AccessKey: "" HasKeyboardFocus: true IsKeyboardFocusable: true IsEnabled: true HelpText: "" IsPassword: false IsOffscreen: false ProviderDescription: "[pid:10256,hwnd:0x0 Main(parent link):Microsoft: MSAA Proxy (unmanaged:uiautomationcore.dll)]" SelectionItem.IsSelected: true SelectionItem.SelectionContainer: "Ribbon Tabs" tab IsDockPatternAvailable: false IsExpandCollapsePatternAvailable: false IsGridItemPatternAvailable: false IsGridPatternAvailable: false IsInvokePatternAvailable: false IsMultipleViewPatternAvailable: false IsRangeValuePatternAvailable: false IsScrollPatternAvailable: false IsScrollItemPatternAvailable: false IsSelectionItemPatternAvailable: true IsSelectionPatternAvailable: false IsTablePatternAvailable: false IsTableItemPatternAvailable: false IsTextPatternAvailable: false IsTogglePatternAvailable: false IsTransformPatternAvailable: false IsValuePatternAvailable: false IsWindowPatternAvailable: false IsItemContainerPatternAvailable: false IsVirtualizedItemPatternAvailable: false FirstChild: [null] LastChild: [null] Next: "Model" tab item Previous: [null] Other Props: Object has no additional properties Children: Container has no children Ancestors: "Ribbon Tabs" tab "The Ribbon" pane "Innovaya Studio with Sage (Archtectural 2017_V1.invx)" window "Desktop" pane Link to comment Share on other sites More sharing options...
junkew Posted April 7, 2018 Share Posted April 7, 2018 Simplespy gives you the hierarchy of elements and gives example code. As long as parents get highlighted you know you are recognizing the element. After that you can add the actions like setfocus click setvalue etc. You need the parents to setfocus first you cannot uncomment them all. FAQ 31 How to click some elements, FAQ 40 Test automation with AutoIt, Multithreading CLR .NET Powershell CMDLets Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now