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.
UI Automation CreatePropertyCondition 0xc0000005
NativeWindowHandle Returns 0, but Spy displays handle
Can we “click” on edit boxes using Microsoft UIAutomation libraries
Test flex mobile application built with 4.10 sdk with testcomplete
TreeWalker cant see AutomationElement, but UIA Verify can
Accessing elements of webview within a native iPhone app using UI Automation
Ranorex not able to recognise elements uniquely?
Getting / ussing full path to find controls in UIA and White
UIA: Get ControlType from control type name (string)
how to select which button to select in alert message for IOS UIAutomation
How to run multiple .trace files in one run i.e one after the other in UI automation tool?
Using TestComplete's UIAObject with Microsoft UI Automation Control Patterns
scrollToVisible error while testing on a device, UIAutomation
How to select font node in Sahi?
count the number of rows/columns using UI Automation
How to find image on whole screen?