comboBox lists access : Automation API

comboBox lists access

Class library usage, coding and language questions.

comboBox lists access

Postby JoeR » Fri Dec 03, 2010 7: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.
JoeR
 
Posts: 26
Joined: Fri Dec 03, 2010 7:15 pm
Location: Morrisville, NC

Re: comboBox lists access

Postby Ciege » Fri Dec 03, 2010 8: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...
User avatar
Ciege
 
Posts: 965
Joined: Thu Oct 16, 2008 7:46 pm
Location: Arizona, USA

Re: comboBox lists access

Postby JoeR » Fri Dec 03, 2010 8: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 38 times
JoeR
 
Posts: 26
Joined: Fri Dec 03, 2010 7:15 pm
Location: Morrisville, NC

Re: comboBox lists access

Postby Ciege » Fri Dec 03, 2010 9: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
Ciege
 
Posts: 965
Joined: Thu Oct 16, 2008 7:46 pm
Location: Arizona, USA

Re: comboBox lists access

Postby Support Team » Mon Dec 06, 2010 1: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
User avatar
Support Team
Site Admin
 
Posts: 4838
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria

Re: comboBox lists access

Postby JoeR » Mon Dec 06, 2010 4: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 28 times
JoeR
 
Posts: 26
Joined: Fri Dec 03, 2010 7:15 pm
Location: Morrisville, NC

Re: comboBox lists access

Postby Support Team » Mon Dec 06, 2010 5: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
User avatar
Support Team
Site Admin
 
Posts: 4838
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria

Re: comboBox lists access

Postby JoeR » Mon Dec 06, 2010 5: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 36 times
JoeR
 
Posts: 26
Joined: Fri Dec 03, 2010 7:15 pm
Location: Morrisville, NC

Re: comboBox lists access

Postby Support Team » Mon Dec 06, 2010 8: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
User avatar
Support Team
Site Admin
 
Posts: 4838
Joined: Fri Jul 07, 2006 5:30 pm
Location: Graz, Austria


Return to Automation API

Who is online

Users browsing this forum: No registered users and 0 guests