Dev Express ComboBox : Automation API

Dev Express ComboBox

Class library usage, coding and language questions.

Dev Express ComboBox

Postby atom » Mon Apr 18, 2011 5:09 pm

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
atom
 
Posts: 339
Joined: Mon Dec 08, 2008 12:14 am
Location: Dublin, Ireland

Re: Dev Express ComboBox

Postby atom » Mon Apr 18, 2011 5:10 pm

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
atom
 
Posts: 339
Joined: Mon Dec 08, 2008 12:14 am
Location: Dublin, Ireland

Re: Dev Express ComboBox

Postby Ciege » Mon Apr 18, 2011 5:38 pm

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...
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...
User avatar
Ciege
 
Posts: 965
Joined: Thu Oct 16, 2008 7:46 pm
Location: Arizona, USA

Re: Dev Express ComboBox

Postby atom » Tue Apr 19, 2011 11:32 am

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!
atom
 
Posts: 339
Joined: Mon Dec 08, 2008 12:14 am
Location: Dublin, Ireland


Return to Automation API

Who is online

Users browsing this forum: No registered users and 0 guests