This project is read-only.

Accessing Tab Controls

Jul 9, 2009 at 2:05 PM

Has anyone figureout a way to access a tab control? I am trying to navigate between tab controls but I am not sure how to do this with White. 

Jul 9, 2009 at 2:09 PM
Edited Jul 9, 2009 at 2:14 PM


do you mean tabs like firefox tab`s?


if so I do the following



Window window = Application.GetWindow("Name");

UIItem item = window.Get<UIItem>(SearchCriteria.ByControlType(ControlType.TabItem).AndByText("<Name of the tab>");




Jul 9, 2009 at 3:49 PM

Thanks.  Your solution was a great place to start, but I am still stuck at one step.   It seems that I have a tab control which has multiple tab items within it.   I am trying to find away to access the tab control and then access the children tab items within it.  Any suggesstions?

Jul 9, 2009 at 5:36 PM

I finally found a way to click the one the individual tabs inside the tab control.  I've shown my steps below.

//*** How to find main tab control ***
Core.UIItems.TabItems.Tab mainEditTab = EditCustomerWin.Get<Core.UIItems.TabItems.Tab>(Core.UIItems.Finders.SearchCriteria.ByControlType(ControlType.Tab));

//*** Individual tab ***
 Core.UIItems.TabItems.TabPage IdentificationTab = EditCustomerWin.Get<Core.UIItems.TabItems.TabPage>(Core.UIItems.Finders.SearchCriteria.ByControlType(ControlType.TabItem).AndByText("Identification"));

Jul 10, 2009 at 8:04 AM

Great work.

I'm confused, why it is a problem to have direct access to the TabItems on your system and on my not.

I have a Tab as parent element too but I don't need it. maybe it is the TabPage element.



Jul 10, 2009 at 2:12 PM

Your actually right. I didn't need to access the main tab to access the tab element inside.  I posted more of my example code then was necessary. 

I now trying to find a way to access the items inside of datagrid control that for some reason is seen as a pane control.   I know there are elements inside the datagrid but for some reason White not UISPy sees them. Any you have additional suggestion I would appreciate the help.