Unable to cast object of type 'Castle.Proxies.TabPageProxy' to type 'White.Core.UIItems.TabItems.Tab'.

Sep 11, 2012 at 6:55 PM

I am trying to retrieve a White.Core.UIItems.TablItems.Tab UI element, but I am getting a Castle.Proxies.TabPageProxy type. It won't let me cast this. How can I fix this? I just want to get a Tab UI item.

SearchCriteria crit = SearchCriteria.ByAutomationId("StatusTab");

White.Core.UIItems.IUIItem item = window.Get(crit);

White.Core.UIItems.TabItems.Tab tab = item;

item returned is a Castle.Proxies.TabPageProxy type. So I get this exception:

Exception: System.InvalidCastException: Unable to cast object of type
'Castle.Proxies.TabPageProxy' to type 'White.Core.UIItems.TabItems.Tab'.

I tried to put a "using" declaration in my code for Castle.Proxies, but that is apparently not in Castle.Core or Castle.DynamicProxy2 dlls.

Sep 11, 2012 at 8:24 PM

I fixed my own problem: I just quit trying to use a Tab class. I used IUIItem instead.