Working with tabs and panes

Feb 20, 2008 at 3:00 PM
Edited Feb 20, 2008 at 3:04 PM
Using UISpy I have a tree like

  • window
    • tab
    • tab
      • pane
        • pane
          • tree
            • pane}
Using as many combinations of Get(SearchCriteria) as I can think of I can't seem to get to anything below tab.
Anyone know how to do this?


EDIT: Sorry, had trouble with wiki syntax
Coordinator
Feb 21, 2008 at 5:16 AM
Do you have a some sample code which I can try this on?
By the way, you need to have the tab selected before you can select anything from it.
Feb 22, 2008 at 2:35 PM
Not sure that I could get you the code. I'm trying to automate an old legacy vb6 forms system.

That said, I did get a little farther.
I saw what you were doing in Desktop.cs and worked from there..
var mainWindow = application.Find(x => x.StartsWith("OMNIA"),InitializeOption.NoCache);

var finder = new AutomationElementFinder(mainWindow.Tabs1.AutomationElement);
var element =
finder.Child(new AutomationSearchCondition[]
{AutomationSearchCondition.ByControlType(ControlType.Pane).OfName("Applications")});
finder = new AutomationElementFinder(element);
var tree = finder.Child(AutomationSearchCondition.ByClassName("TreeView20WndClass").OfControlType(ControlType.Pane));

So this gets me as far as having the automation element for the treeview. Now I can't seem to do much with that, so I changed the constructor on "Tree" to be public and instantiated one passing the (tree) automation element and the ActionListener from mainWindow.

My first test was to try HasNode, but that fails and doesn't find one.

This is what UISpy tells me about the automation element I am trying to turn into a tree
AutomationElement
General Accessibility
AccessKey: ""
AcceleratorKey: ""
IsKeyboardFocusable: "False"
LabeledBy: "(null)"
HelpText: ""

State
IsEnabled: "True"
HasKeyboardFocus: "False"

Identification
ClassName: "TreeView20WndClass"
ControlType: "ControlType.Pane"
Culture: "(null)"
AutomationId: ""
LocalizedControlType: "pane"
Name: ""
ProcessId: "5868 (MAUI)"
RuntimeId: "42 790112"
IsPassword: "False"
IsControlElement: "True"
IsContentElement: "True"

Visibility
BoundingRectangle: "(164, 196, 240, 859)"
ClickablePoint: "283,625"
IsOffscreen: "False"

ControlPatterns
Scroll
HorizontalScrollPercent: "0"
HorizontalViewSize: "93.2806324110672"
VerticalScrollPercent: "-1"
VerticalViewSize: "100"
HorizontallyScrollable: "True"
VerticallyScrollable: "False"

Any ideas?
Feb 22, 2008 at 2:35 PM
Edited Feb 22, 2008 at 2:36 PM
EDIT: Sorry it double posted on me.
Coordinator
Feb 25, 2008 at 10:36 AM
Can you send me two things then:
1. Send me you test code.
2. Use UISpy and do File->Save Snapshot From Current View. Keep the window selected in the tree.