I can open the dropdown list using this code fine:
foreach (Control control in _form.Controls)
{
Element objDropDown = control.Element.FindChild(role, name, className, location);
if (objDropDown != null)
{
// click the dropdown list
objDropDown.DoDefaultAction();
rc = 0;
break;
}
}
After the list is open, I don't know how to select an item. I don't know how to use the spy to get the info on the dropdown items since the dropdown list closes as soon as I activate the spy.
PushButton - how can I select an item from the dropdown list
- Support Team
- Site Admin
- Posts: 12145
- Joined: Fri Jul 07, 2006 4:30 pm
- Location: Houston, Texas, USA
- Contact:
If you enable the HotTracker, you can also check menus and popup menus with the Spy.I don't know how to use the spy to get the info on the dropdown items since the dropdown list closes as soon as I activate the spy.
You can use the function PopupMenuSelectItem() or ContextMenu.SelectItemText() for selecting a menu item in a popup menu.
Jenö
Ranorex Support Team