How to test element with ambiguous names

Apr 22, 2010 at 10:35 PM


I have a page with multiple user controls on it. I want to test a combobox that is part of the user control. So with two of these user controls on the same page the combobox's name is not unique. How can I access these elements?

The user controls are given unique names, can I access the child element with naming like 'PARENT.CHILD'?


Rob Smyth

Apr 23, 2010 at 6:47 AM


You have to create a Class which inherit CustomUiItem as you do it in your other post.

the class handle the custom control.

This is the best way, the other way might be to get all comboboxes, like

IUIItem[] items = page.GetMultiple(SearchCriteria.ByControlType(ControlType.ComboBox));

and now use the index. (GetMultiple works only on WPF)