Flex 4 spark ComboBox getting classified as an element

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
jhorton
Posts: 8
Joined: Tue Aug 17, 2010 10:11 pm

Flex 4 spark ComboBox getting classified as an element

Post by jhorton » Wed Aug 25, 2010 8:36 pm

I'm trying to write some code to be able to select one of the index's from a spark.componets::ComboBox componet in a flex 4 application. I have the automation libraries compiled into the flex 4 app. When I use Element Browser to spy the object it gets identified as Element which I assume means it doesn't know what it is. I have tried to cast the object to a comboBox by doing this.
Ranorex.ComboBox comboBox = (Ranorex.ComboBox)WMCRepository.Instance.WMC.TopBar.ElementAvailableModules;
But when I try to compile it I get the error : Cannot convert type 'Ranorex.Unknown' to 'Ranorex.ComboBox' (CS0030)

I'm using Ranorex 2.3.4 and I saw in the 2.3.3 release notes that support for the spark family of components were supported. What am I doing wrong?
SparkComboBox.rxsnp
spark combo box snapshot.
(3.47 KiB) Downloaded 266 times

User avatar
sdaly
Posts: 238
Joined: Mon May 10, 2010 11:04 am
Location: Dundee, Scotland

Re: Flex 4 spark ComboBox getting classified as an element

Post by sdaly » Thu Aug 26, 2010 8:12 am

If you haven't already, then try the following...

If you have managed to track the combobox in Spy then simply drag the element into your code. Then do whateveritscalled.Click

Then, hover over a list item in the combobox and hold down ctrl+windowsButton to track the item. Drag that tracked item into your code and do whateveritscalled.Click.

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

Re: Flex 4 spark ComboBox getting classified as an element

Post by Support Team » Thu Aug 26, 2010 9:57 am

Jeremy,

It looks like the spark combobox has not been correctly mapped as a combobox (by us).

To select an item, you have to open the drop down and select an item there
(the dropdown is a container with a path like flexobject/container[@id="dropDown"]).
This can get a bit nasty, however, if you need to scroll, because items are usually not available until scrolled.

Another possibility is to try and select the item directly:

Code: Select all

yourComboBox["selectedItem"] = "<string>"+itemText+"</string>";
yourComboBox["selectedIndex"] = "<number>"+index+"</number>";
"selecteditem" might not work with more complex data items.

Michael
Ranorex Team
.
Image

jhorton
Posts: 8
Joined: Tue Aug 17, 2010 10:11 pm

Re: Flex 4 spark ComboBox getting classified as an element

Post by jhorton » Thu Aug 26, 2010 3:24 pm

Thanks for the help. If I open the drop down first I can then click on one of the objects inside as you described. Hopefully this will be something that we can get fixed in the next release(3.0) ;)

jhorton
Posts: 8
Joined: Tue Aug 17, 2010 10:11 pm

Re: Flex 4 spark ComboBox getting classified as an element

Post by jhorton » Tue Aug 31, 2010 9:44 pm

It seems like the spark family in general doesn’t get identified very well. The spark TabBar object isn’t getting recognized as a TabBar/TabPage either. Do you happen to know if that is something that might be fixed in 3.0 timeframe?

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

Re: Flex 4 spark ComboBox getting classified as an element

Post by Support Team » Wed Sep 01, 2010 12:36 pm

Hi,

There are some controls, not often, which have the wrong role. In your case it seems that the TabBar/TabPage has no role and therefore Ranorex recognize the item as element, but there shouldn't be a problem to automate this element. All information should be available, the element is just not displayed as a TabPage. I will add an issue to our internal bug tracking tool regarding to the problem.

Regards,
Peter
Ranorex Team
.
Image