Page 1 of 1

why I can’t set selectedITemIndex of combo box ?

Posted: Thu Aug 18, 2011 2:07 pm
by mohan
Hi there,

I’m getting an exception whenever trying to set some of the property of combo Box like DropDownVisible, SelectedItemIndex etc. let say I'm trying to execute the below line of code

objShipment.FormShipment.cmbFrom.SelectedItemIndex = 3;

Thrown exception “Setting attribute 'selecteditemindex' failed on element '{ComboBox:ComboBox}'.” {"The operation is not supported."}

May I know why I can’t set selectedITemIndex of combo box? . If I do the same operation with Microsoft dot.net combo, it doesnot throw any exception.

FYI, The Application under Test is developed using VB6.0 and Ranorex version is 3.0.5.

Regards,
Mohan

Re: why I can’t set selectedITemIndex of combo box ?

Posted: Fri Aug 19, 2011 11:29 am
by Support Team
The Ranorex.ComboBox class is an adapter for combo boxes from all kind of technologies. And while setting the SelectedItemIndex should work in general, setting this property is not supported for each and every technology supported by Ranorex.
For example, setting this property for a Ranorex.ComboBox corresponding to a Windows Forms ComboBox control will work, but setting it for a combo box from the MSAA technology is not supported due to lack of functionality within MSAA.

Regards,
Alex
Ranorex Team