@vadim: Thank you
I encountered the exact same problem and was able to solve it with vadims workaround.
Accessing ComboBoxes is indeed a bit tricky. It seems the list items that are inside the combobox can not be found by Ranorex Spy unless the ComboBox has been dropped down at least once (after it has been dropped down finding the elements is possible even if the box has been closed again).
The Items by the way can not just be found using the ComboBox itself once it´s dropped down, but they are also represented inside a Container 'DropDownScrollViewer', which does not belong to the original application, but to a independent /form[@classname='Popup']. If I track one ListItem with Spy, then Spy will show the item in the container from the popup form. If there were multiple items inside the menu, Spy however won´t show other ListItems inside this container.
Problematic is, that even if the list items can be found by Ranorex Spy using a rXcode like
Code: Select all
//combobox[@automationid='SA20131210115604']/?/?/listitem
and trying to create adapters using
Code: Select all
IList<Ranorex.ListItem> itemList = repo.AddScripDialog.Popups.AllScriptListItemsInfo.CreateAdapters<Ranorex.ListItem>();
only the first ListItem will be added to the adapter with no apparent reason.
Based on vadims solution I also changed the rXpath to:
Code: Select all
//combobox[@automationid='SA20131210115604']
And the adapter creation to
Code: Select all
IList<Ranorex.ListItem> itemList = repo.AddScripDialog.Popups.AllScriptListItemsInfo.Find<Ranorex.ListItem>(".//ListItem");
and voila, all the ListItems appeared.