comboBox lists access

Class library usage, coding and language questions.
JoeR
Posts: 32
Joined: Fri Dec 03, 2010 6:15 pm
Location: Morrisville, NC
Contact:

comboBox lists access

Post by JoeR » Fri Dec 03, 2010 6:29 pm

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.

User avatar
Ciege
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: comboBox lists access

Post by Ciege » Fri Dec 03, 2010 7:16 pm

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

JoeR
Posts: 32
Joined: Fri Dec 03, 2010 6:15 pm
Location: Morrisville, NC
Contact:

Re: comboBox lists access

Post by JoeR » Fri Dec 03, 2010 7:57 pm

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.
Attachments
comboBox2.rxsnp
comboBox
(5.59 KiB) Downloaded 277 times

User avatar
Ciege
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: comboBox lists access

Post by Ciege » Fri Dec 03, 2010 8:25 pm

Ah, flash... Well then I'll have to bow out from this since I don't do any flash testing at all... Sorry...
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
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: comboBox lists access

Post by Support Team » Mon Dec 06, 2010 12:55 pm

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

JoeR
Posts: 32
Joined: Fri Dec 03, 2010 6:15 pm
Location: Morrisville, NC
Contact:

Re: comboBox lists access

Post by JoeR » Mon Dec 06, 2010 3:59 pm

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.
Attachments
comboBox3.rxsnp
(5.59 KiB) Downloaded 194 times

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

Re: comboBox lists access

Post by Support Team » Mon Dec 06, 2010 4:34 pm

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

JoeR
Posts: 32
Joined: Fri Dec 03, 2010 6:15 pm
Location: Morrisville, NC
Contact:

Re: comboBox lists access

Post by JoeR » Mon Dec 06, 2010 4:40 pm

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
Attachments
list.rxsnp
(33.08 KiB) Downloaded 229 times

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

Re: comboBox lists access

Post by Support Team » Mon Dec 06, 2010 7:11 pm

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

komeershettyvinod
Posts: 2
Joined: Thu Feb 12, 2015 8:34 am

Re: comboBox lists access

Post by komeershettyvinod » Thu Mar 05, 2015 3:00 pm

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

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: comboBox lists access

Post by krstcs » Thu Mar 05, 2015 5:14 pm

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.
Shortcuts usually aren't...