White doesn't recognize the container (pane control) in tab

500 views
Skip to first unread message

Shan

unread,
Sep 2, 2014, 2:54:23 AM9/2/14
to teststa...@googlegroups.com
Hi,

I'm automating the windows application. I tried to access the pane element(which has text box, combo box controls) under tab control, but it's not accessible. White returns null.

I tried other techniques like UI automation TreeWalker (Rawview, Control view, content view), but nothing helps.

As in below picture 1, tab control is retrieved properly by White/UI Automation, but the child element General* Pane is not returned and it's controls are not accessible (Refer pic 2 highlighted), the first accessible child element is "General* tab Item".

Strange thing is, these controls are accessible in Inspect.exe (in windows SDK). I tried following methods to retrieve controls, but General* Pane is never accessible through White/UI Automation.


var tab = Window.Get<Tab>(SearchCriteria.ByControlType(ControlType.Tab).AndByClassName("TwoPageControl")); // Tab control is retrieved properly
var pane = tab.GetElement(SearchCriteria.ByControlType(ControlType.Pane).AndByText("General*")); // this line returns NULL

var pane1 = revWindow.GetElement(SearchCriteria.ByControlType(ControlType.Pane).AndByText("General*")); // this line returns NULL
var pane2 = revWindow.Get<Panel>(SearchCriteria.ByControlType(ControlType.Pane).AndByText("General*"));// throws exception "Failed to get ControlType=pane,Name=General*,ControlType=pane"

Tried windows UI automation code as well, but no luck.

 System.Windows.Automation.Condition cd1 = new AndCondition(
                new PropertyCondition(AutomationElement.ControlTypeProperty, ControlType.Tab),
                new PropertyCondition(AutomationElement.ClassNameProperty, "TwoPageControl"));     

            AutomationElement a = window.FindFirst(TreeScope.Descendants, cd1); // Tab control is returned properly here

          TreeWalker rawViewWalker = TreeWalker.RawViewWalker;
            AutomationElement cc = rawViewWalker.GetFirstChild(a); // General * Pane is not returned, instead General* Tab item is returned, though it's not the first child.
            var cd = rawViewWalker.GetNextSibling(cc);  // this returns next pane element available, not General * Pane.
           
 
Please help me how to access General * Pane and it's children under tab control. Any help is much appreciated.

Rubem Rocha

unread,
Aug 22, 2017, 9:13:40 AM8/22/17
to TestStack.White
I have the same issue.

How to turn around this?

[]s
Reply all
Reply to author
Forward
0 new messages