Unable to select a drodown list item
Posted: Sat Jan 05, 2008 1:55 am
AUT: Windows app written in Delphi using DevExpress for UI controls
I recorded the action, and the recorder produced the code below. It replays fine. However when I try to do the same thing in my test code, the dropdown list closes right after it's clicked, and my test code fails to click a drodown list item:
Code generated by the recorder:
// Find child by class name
control = form.FindClassName("TomLookupCachedCombo", 5);
control.Focus();
Mouse.ClickControl(control, MouseButtonType.LeftButton, new Point(159, 9), 1, 100);
//-----------------------------------------------------------------
// Find form by title and class name
//-----------------------------------------------------------------
form = Application.FindForm("", SearchMatchMode.MatchExact, "ComboLBox", false, 5000);
formElement = form.Element;
// Find child element by Role=ListItem Name=DIR - Direct Business
element = formElement.FindChild(Role.ListItem, "DIR - Direct
Business", null);
I recorded the action, and the recorder produced the code below. It replays fine. However when I try to do the same thing in my test code, the dropdown list closes right after it's clicked, and my test code fails to click a drodown list item:
Code generated by the recorder:
// Find child by class name
control = form.FindClassName("TomLookupCachedCombo", 5);
control.Focus();
Mouse.ClickControl(control, MouseButtonType.LeftButton, new Point(159, 9), 1, 100);
//-----------------------------------------------------------------
// Find form by title and class name
//-----------------------------------------------------------------
form = Application.FindForm("", SearchMatchMode.MatchExact, "ComboLBox", false, 5000);
formElement = form.Element;
// Find child element by Role=ListItem Name=DIR - Direct Business
element = formElement.FindChild(Role.ListItem, "DIR - Direct
Business", null);