Page 1 of 1

comboBox lists access

Posted: Fri Dec 03, 2010 6:29 pm
by JoeR
I am trying to acces the list of items in a comboBox to no avail. Here is the code I am using:

Code: Select all

Ranorex.ComboBox comboBox = "/dom[@domain='10.0.0.114:8443']/body/flexobject/element[@id='swfLoader']/element/element/container/container[@id='modulesCanvas']/element[@type='EmployeeDetails']/container[@type='VBox']/container[@type='Canvas']/container/container[@id='identificationForm']/container/form/container[2]/container[2]/container[@id='_EmployeeDetailsIdentification_FormItem3']/combobox[@id='title']";
			
// Open combobox using property   
comboBox.DropDownVisible = true; 
comboBox.EnsureVisible();
			
// Open combobox by clicking the   
// drop down button   
Ranorex.Button open = comboBox.FindChild<Ranorex.Button>();
open.Focus();
open.Click();      
			
IList<ListItem> items = comboBox.Items;
The list that is created in items is empty. I have tried other methods to access this to now avail. I need to access this list and interate through it to determine if an entry is present. Entries can be added or delete and I need to verify the effect of those actions on the list.

Re: comboBox lists access

Posted: Fri Dec 03, 2010 7:16 pm
by Ciege
Use RanorexSpy to check out how the combobox's list is actually created. Is there a .Items property for your combobox? My guess is that you will see a List element that then contains the ListItems.

Re: comboBox lists access

Posted: Fri Dec 03, 2010 7:57 pm
by JoeR
I have checked and there is not a list associated with the comboBox in Spy. I have attached a Ranorex snapshot of the comboBox. Also, this is with a Flash/Flex application.

Re: comboBox lists access

Posted: Fri Dec 03, 2010 8:25 pm
by Ciege
Ah, flash... Well then I'll have to bow out from this since I don't do any flash testing at all... Sorry...

Re: comboBox lists access

Posted: Mon Dec 06, 2010 12:55 pm
by Support Team
Hi,

If you open the combo-box and use instant tracking to get the items of the combo-box, a Container named "dataGroup" should be available in Spy. Nested under this container, all items of the combo-box should be available. With this list of items you can check your items if they exists or not.
For instant tracking, please take a look to following link
http://www.ranorex.com/support/user-gui ... html#c1797

Regards,
Peter
Ranorex Team

Re: comboBox lists access

Posted: Mon Dec 06, 2010 3:59 pm
by JoeR
Peter,

I have used instant tracking with the comboBox. However, I do not see the "dataGroup" Container nor do I see the list in any form. I have attached the snapshot for the comoBox obtained using instant tracking.

Re: comboBox lists access

Posted: Mon Dec 06, 2010 4:34 pm
by Support Team
Hi,

I tried to reproduce the problem but it was working as expected. There should be a "dataGroup" container under the Flex Object in Spy. Would it be possible to send us a sample application with your combo-box inside? So we can reproduce the issue and send you a solution.

Regards,
Peter
Ranorex Team

Re: comboBox lists access

Posted: Mon Dec 06, 2010 4:40 pm
by JoeR
If I drop the list down by licking the comboBox button and then use instant tracking then I get access to the list. However, by looking at the Ranorex Path it does not look like the list is associated with the comboBox. Attached is the list snapshot. Why does it not appear with the comboBox in the Ranorex Path.

Joe

Re: comboBox lists access

Posted: Mon Dec 06, 2010 7:11 pm
by Support Team
JoeR wrote:Why does it not appear with the comboBox in the Ranorex Path.
..., because the drop-down of a Flex combo box is actually a control of its own and only logically linked to the combo box. Ranorex reflects the visual outline of an application, not its logical structure (which would be very hard to guess). In most cases visual and logical views match. And if not, the RanoreXPaths you get with Ranorex Spy will still make it easy to identify such UI elements.

Regards,
Alex
Ranorex Team

Re: comboBox lists access

Posted: Thu Mar 05, 2015 3:00 pm
by komeershettyvinod
Hi ,

I'm facing similar problem as faced by Joe..

I'm unable to select a list value from combo box. and when spyed on the element combox and list are displayed differently..

Please help me out...

Thanks,
Vinod

Re: comboBox lists access

Posted: Thu Mar 05, 2015 5:14 pm
by krstcs
Please provide more information.

What version of Ranorex are you using?
What version of Windows are you running on?
What technology is your system under test developed in? (HTML, Flash/Flex, WPF, Java, etc.)

Please include a snapshot of the element in question as well as the XPath you are using to identify the object. You can find information on creating a snapshot here.