Cannot retrieve Table items

Nov 12, 2010 at 4:49 AM

I have a .NET application from where I should get data from Table control. UISpy does not see any childs of Table control (rows, headers etc). I also have my own program which could see childs.

When I am using White library I dont try to make unit-tests, I just use it as library, from code. I made console application and calling White methods from it but it could not see any rows for Table too.

My own application have [STAThread] mark for function 'Main'. Then I am removing it, it also could not see Table childs. But then I placing this attribute to console application using White library, it hangs trying to get Table childs.

Please tell me are there any ways to get it working?



Nov 12, 2010 at 2:45 PM

I could confirm what problem was only in [STAThread] attribute. The same code with this attribute set for main thread was able to find controls I needed and without it it was unable to find them.


Another question arised here. This table is a custom control, so its names for headers, rows and so on does not match with standard ones.  I have found what it names could be changed using UIItemIdAppXmlConfiguration class, but parsing templates could not. For example, row item name is looks like this 'Band 0 Row 1' (contains 4 parts, row numbers starts from 1). So it could not be found using

rowPredicate =

delegate(AutomationElement element) { return element.Current.Name.StartsWith(UIItemIdAppXmlConfiguration.Instance.TableColumn) && element.Current.Name.Split(' ').Length == 2; };

 Do you have any plans to make this predicate configurable?