UI Automation Verify v/s UISpy - The way they find UI elements
I am trying to automate UI interactions for a C++ MFC application. I tried to find elements' automation ID using UISpy and UIAVerify tools. I am on win2k3. There is a tab control, the automation ID of which is visible to UISpy but not to UIAVerify. The issue is - it is not visible even to the C# code that I write using Project White framework or ui automation framework of .net 3.0. I want to get handle to this control the way UISpy gets it. Is there any way I can find out how UISpy does it? Thanks!!!
UISpy is likely using Microsoft UI Automation under the covers. You can see how this works from this example*. There are all kinds of conditions on AutomationElement which you can use to locate them. I've only worked with WPF tabs, but found it really, really hard to locate them by Automation Id. Instead I've been using the AutomationName property, with the title on the tab as the value. Not sure if White supports this, but I'm pretty sure you can get the original AutomationElement out and use it as per the example. You'll also probably be looking for something supporting the SelectionItemPattern (there's a SelectionItemIsSupportedProperty), and you'll need to use the pattern to select the tab and make it active before you can see anything in it. Please comment if you need any more info. It might help to know what the structure of your container with tabs in is. *Declaration of interest since I wrote this.
White/UI Automation doesn't recognize the container (pane control) in tab
How to get descendants of a panel in teststack.white
Microsoft UI Automation: Invoke Pattern Exception
System.Windows.Forms.ListView Check box is not recognized by UIA verrify
UISearchDisplayController and UIAutomation
Handle UI Automation Mouse and Keyboard events
Add CodedUI to Test Manager
UI Automation + Mechanic.js: selector issue
White Automation framework throws an exception when using “White.Core.Desktop” Class
Unable to uncheck a checkbox within a combo box
Coded UI - Add-ons
Is it possible to close app in UIAutomation in iOS
ios uiAutomation tapWithOptions not working properly
My automationelement FindFirst/FindAll seems to be very slow. How to improve the performance?
UI Automation CreatePropertyCondition 0xc0000005
NativeWindowHandle Returns 0, but Spy displays handle