Problem with discovering objects - Focus Tracking mechanizm as a solution

Jun 2, 2011 at 1:32 PM
Edited Jun 2, 2011 at 5:38 PM

Hi,

I'm testing very old application written in Borland C++. I'm trying to prepare automated tests for it based on open solutions.
I chose White project which bases on UI Automation libraries as I want to join my tests with nUnit and Hudson.

Generally I don't have problem with recognizing objects but when I try to recognize content inside the tab contained in Tab Panel or try to see MenuItems of Menu bar
then UI Automation/UI Verify works wired. When I run UI Verify (the previous version because the new one doesn't work on my box) I see that objects can be 'catch' (noticed) only then
when I set 'Focus tracking' option and click on target object or change the keyboard cursor on it. Otherwise it's impossible to find them.

This is an example code I use for my White/UI Automation libraries to get to the mentioned above elements:

Tab tab = window.Get<Tab>();
ITabPage tabPage = tab.SelectedTab;
AutomationElementCollection myCollection = tabPage.AutomationElement.FindAll(TreeScope.Descendants, Condition.TrueCondition);
window.Get<Button>("buttonName");

unfortunately myCollection is empty even though UI Verifyier can show me children of my 'tab' panel.

Can you please help me to describe how the mechnizm of tracking is implemented because I'm interested to integrate it/create similar solution in my project.

Regards
R.