Page 1 of 1

Flex 4 spark ComboBox getting classified as an element

Posted: Wed Aug 25, 2010 8:36 pm
by jhorton
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

Re: Flex 4 spark ComboBox getting classified as an element

Posted: Thu Aug 26, 2010 8:12 am
by sdaly
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.

Re: Flex 4 spark ComboBox getting classified as an element

Posted: Thu Aug 26, 2010 9:57 am
by Support Team
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

Re: Flex 4 spark ComboBox getting classified as an element

Posted: Thu Aug 26, 2010 3:24 pm
by jhorton
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) ;)

Re: Flex 4 spark ComboBox getting classified as an element

Posted: Tue Aug 31, 2010 9:44 pm
by jhorton
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?

Re: Flex 4 spark ComboBox getting classified as an element

Posted: Wed Sep 01, 2010 12:36 pm
by Support Team
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