Page 1 of 1

Dev Express ComboBox

Posted: Mon Apr 18, 2011 4:09 pm
by atom
Hiya

I have a control of type:

DevExpress.XtraEditors.ComboBoxEdit

But Ranorex Spy see's this as two controls:

- Text
- Button

Why can't it map it to Ranorex.ComboBox ?

Thanks

Re: Dev Express ComboBox

Posted: Mon Apr 18, 2011 4:10 pm
by atom
It means I have to write my own wrapper to Invoke Remotely to do the most basic things like:

- Get list of items in combo box
- Select an item

Thanks

Re: Dev Express ComboBox

Posted: Mon Apr 18, 2011 4:38 pm
by Ciege
We also use the same DevExpress combos in our AUT, but you do not need to use InvokeRemotely to access the information within them. But it does take just a little bit of work.

What I do in my ComboSelect method is (with error checking and logging removed for brevity):

1) Find the Combo then it's associated Open button

Code: Select all

HDComboBox = RanorexFormName.FindSingle(".//combobox[@controlname='" + ComboBoxName + "' or @text='" + ComboBoxName + "' or @controlid='" + ComboBoxName + "']", 60000);
HDComboOpenButton = HDComboBox.FindSingle("button[@accessiblename='Open']", 30000);
2) Open the Combo by clicking the Open button

Code: Select all

HDComboOpenButton.Click();
3) Find the ListItem I want to click & scroll to it if it is not visible

Code: Select all

HDComboBoxListItem = HDComboBox.FindSingle<ListItem>("list/listitem[@accessiblename='" + ComboBoxItem + "' or @text='" + ComboBoxItem + "']");

if (HDComboBoxListItem.Visible == false)
{
    HDComboListScrollBar = HDComboBox.FindSingle(".//scrollbar[@accessiblename='Vertical']", 60000);
    if (HDComboListScrollBar.Value != 0)
    {
        HDComboListPageUp = HDComboBox.FindSingle(".//scrollbar/button[@accessiblename='Page up']", 60000);
    }
    while (HDComboListScrollBar.Value != 0)
    {
        HDComboListPageUp.Click();
    }

    HDComboListPageDown = HDComboBox.FindSingle(".//scrollbar/button[@accessiblename='Page down']", 60000);
    while (HDComboBoxListItem.Visible == false)
    {
        HDComboListPageDown.Click();
    }
}

HDComboBoxListItem.Click();
You can use similar code to Open the combo then get the entire list to an array if you want to do that instead of clicking a list item. No Invoke required...

Re: Dev Express ComboBox

Posted: Tue Apr 19, 2011 10:32 am
by atom
Hiya

The problem for me is my company have inherited from Dev Express controls to create new ones
But they have the same properties as Dev Express ones
Argh!