| View previous topic :: View next topic |
| Author |
Message |
sahoko
Joined: 09 Oct 2007 Posts: 9
|
Posted: Sat Jan 05, 2008 2:55 am Post subject: Unable to select a drodown list item |
|
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); |
|
| Back to top |
|
 |
Support Team Site Admin
Joined: 07 Jul 2006 Posts: 311
|
Posted: Mon Jan 07, 2008 12:31 pm Post subject: |
|
Unfortunately I cannot reproduce the problem with the standard Win32 or .NET comboboxes.
From your code, it looks like the Recorder tries to click your combobox control directly to open it.
Try using the Spy to check if the dropdown button on the combobox is available as an element, and then click the element instead of the control.
If that doesnt work please build a mini-example binary, and mail it to support@ranorex.com, as we dont use Delphi.
Michael
Ranorex Support Team |
|
| Back to top |
|
 |
sahoko
Joined: 09 Oct 2007 Posts: 9
|
Posted: Mon Jan 07, 2008 7:29 pm Post subject: |
|
| The spy tells me that the element has the role type of "Client". This element doesn't have a default action associated with it. Is there a function to click this element without any default action? |
|
| Back to top |
|
 |
Support Team Site Admin
Joined: 07 Jul 2006 Posts: 311
|
Posted: Tue Jan 08, 2008 11:31 am Post subject: |
|
It looks like the Delphi combobox is owner-drawn, and that there is a problem with the focus after clicking the control, because the drop-down is an independent top-level window.
If you could send us a sample application where this problem occurs, we can try to figure out whats wrong.
Michael
Ranorex Support Team |
|
| Back to top |
|
 |
Support Team Site Admin
Joined: 07 Jul 2006 Posts: 311
|
Posted: Fri Jan 11, 2008 12:47 pm Post subject: DevExpress Combobox |
|
I finally checked the DevExpress Delphi controls and it seems that most drop-down or combo boxes create client areas, where no further elements are available.
In your example, after clicking the combo box to open the popup, try using the following code, instead of clicking the element:
Code: click into code to enlarge
form = Application.FindFormClassName("TcxComboBoxPopupWindow");
Mouse.ClickControl(form, MouseButtonType.LeftButton, new Point(10,10));
(where Point(x,y) can be any coordinates within the popup window.)
If that does not solve your problems, as a workaround when using comboboxes containing text I suggest using sendkey commands for selecting text, or using arrow up/down for traversing the list.
Michael
Ranorex Support Team |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|