zenocon Posted December 12, 2017 Share Posted December 12, 2017 The documentation on the tree scope even on Microsoft's site https://msdn.microsoft.com/en-us/library/windows/desktop/ee671699(v=vs.85).aspx isn't exactly clear to me. Let's say there's this hierarchy desktop ├── app │ ├── elem1 │ ├── elem2 │ ├── elem3 │ │ ├── elem4 │ │ └── elem5 │ ├── elem6 │ ├── elem7 │ │ ├── elem8 │ │ │ └── elem9 │ │ ├── elem10 │ │ │ └── elem11 │ ├── elem12 │ │ ├── elem13 │ │ └── elem14 I'm mainly interested in only $treescope_descendants, $treescope_subtree, $treescope_children, since I think the others aren't supported. Can someone indicate what the explicit differences are? My guess is _UIA_getObjectByFindAll($app, <selector-that-matches-elem5>, $treescope_children) would fail to find elem5 because elem5 is not a direct child of $app, but _UIA_getObjectByFindAll($app, <selector-that-matches-elem5>, $treescope_subtree) would because it will descend down recursively from all children rooted under $app. Is that a correct statement? If so, can someone explain what $treescope_descendants is for? It sounds like $treescope_descendants is the same as $treescope_subtree but it does not include the top-level element you're starting the search from, whereas $treescope_subtree does include that top-level element and all descendants recursively. Link to comment Share on other sites More sharing options...
junkew Posted December 13, 2017 Share Posted December 13, 2017 Its well explained over here in the tree sections https://msdn.microsoft.com/en-us/library/windows/desktop/ee684007(v=vs.85).aspx Your explanation is nice like a square is equal to a triangle except square has 4 corners instead of 3.😄 You are right that it includes the starting element. 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