This project is read-only.

Not able to get the Pages of Tab

May 5, 2010 at 10:40 AM

   Hello All,

                I was trying work on Tab and I am facing problem. I am not able to retrieve Pages of Tab. When I spy using UIA Verify, I see that it has been recognized as Tab and items as tabitems. But, runtime, I am unable to get the pages. I also tried by the AUtomationID to get hold of Tab and get the pages, but was unsuccessful.

            Application POC = Application.Attach("Javaw");
            Window mge = POC.GetWindow("InfraStruXure Designer");
            AutomationElementCollection allTabs = mge.AutomationElement.FindAll(TreeScope.Descendants, new PropertyCondition(AutomationElement.ControlTypeProperty, ControlType.Tab));
            AutomationElement MyTab = allTabs[4];
            Tab ThisOne= new Tab(MyTab, mge.ActionListener);

Here, the object ThisOne of type Tab is showing the page count as 0.

Could anyone please help me on the same...




May 5, 2010 at 10:56 AM


can you post  the logstructure for the window or the tab element?

May 5, 2010 at 12:34 PM

AutomationId: 68632

ControlType: ControlType.Tab



Bounding rectangle: -31151,-31967,163,501

ClassName: SWT_Window

IsOffScreen: False

FrameworkId: Win32

ProcessId: 2372

AutomationId: 68636

ControlType: ControlType.Pane



Bounding rectangle: -31148,-31941,157,472

ClassName: SWT_Window0

IsOffScreen: False

FrameworkId: Win32

ProcessId: 2372


This is on the Tab Element....

May 5, 2010 at 2:20 PM



there are no pages, this seems to be a problem of this specific control.


the only internal element is a pane where the tabItems should be


It seems that the internal elements not implement Automation Peer correct  and so you can't see them.


mmh UIAVerify see the tabItems, I have no idea why there is a difference to the logstructure.






May 6, 2010 at 8:08 AM

Hello Throndorin,

             We also have a UI element<Custom Control> which is recognized as Pane, but actually I contains Items which can be selected in it. Its more like a listbox, but recognised as Pane. The application is developed in Java and used SWT objects.

             Could you please guide me as to how do I go about it? I do have access to developer here. Should Automation Peer needs to be implemented for the same?

             Is Automation Peer a part of Automation Providers?




May 6, 2010 at 11:05 AM

I'm not really sure what steps for java Applications are necassary.

But have  a look here:

WPF Client Development


as far as I know most Controls have an own AutomationPeer class. This class handles the visibility and the possible methods which are possible on a control (Selection, invoke, and so on)





May 6, 2010 at 12:11 PM

Thanks a Lot Throndorin.


Do you thing a topic "Writing a UI Automation Provider for a Win32-based Custom Control" might help us as SWT is derivative of Win32 I suppose.



May 6, 2010 at 1:12 PM

Yes but I think you should write it in the Microsoft Forum

UIAutomation MSDN Forums


White is "only" a framework for UIAutomation




May 7, 2010 at 9:19 AM

Yes Throndorin. Thanks for all the help :)


May 10, 2010 at 6:55 AM

No Problem ,

please give us a link if you have answers.

May 10, 2010 at 3:39 PM

No Throndorin. I did not get a solution as of now. As the controls are built using GEF of JAVA, we are trying SWTBOT now.