why I can’t set selectedITemIndex of combo box ?

Ask general questions here.
mohan
Posts: 9
Joined: Tue Aug 09, 2011 11:54 am

why I can’t set selectedITemIndex of combo box ?

Post by mohan » Thu Aug 18, 2011 2:07 pm

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

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

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

Post by Support Team » Fri Aug 19, 2011 11:29 am

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
.
Image