White/UI Automation doesn't recognize the container (pane control) in tab
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. refer images in below links: https://dl.dropboxusercontent.com/u/68446125/Tab.png https://dl.dropboxusercontent.com/u/68446125/General%20Pane.png As in 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.
I had exactly the same problem with my application. I use Inspect and open source UIAVerify where Pane element was visible as children of tab element. But when i compile Verify as a .Net 4.5 project, Pane element was not seen as part of tab. It only appears when I pointed it directly. I also search for my Pane element in Descendants of main window but there was nothing. I think it has something to do with dynamically creation of that pane content (i mean there is different content when you choose different tabItem). I think you can't get access to that element from tree point of view. My solution was to use AutomationElement.FromPoint Method. http://msdn.microsoft.com/en-us/library/system.windows.automation.automationelement.frompoint(v=vs.110).aspx I also think this shoud help if you have conntact with people developing program. Some controls on a page are not visible for MS UI Automation
Autoit click with OK button not happening with Windows 10
How much support is given by appium for automation.?
UI performance penalty when using UIAutomation
How to scroll through a UIACollectionView and click on a button?
Webview elements inspection for testing
Galen framework clarifications for automation
UI Automation: Tap on table view cell that’s off screen
UIAWindow > UIAPopover
uiautomator runs multiple tests on multiple devices?
How to link multiple columns to 1 variable in Data driven automation of ranorex
Is there a WebDriver implementation for Microsoft UI Automation (UIA)?
CodedUI test - can't send plain text password into input field
Is it possible to access lock screen elements with iOS UIAutomation?
How to find Window by variable title using TestStack.White framework?
How can I Implement a dynamic timeout in Teststack White?
How to specify Contains in UI Automation PropertyCondition