#9 ✓resolved
Ilkka Kudjoi

Make FunFX choose most extended class implementation for custom component

Reported by Ilkka Kudjoi | February 13th, 2009 @ 01:58 PM

I tried to automate a slightly extended Tree component with FunFX but I found that FunFX was not able to e.g. select anything from the tree, because it tried to automate it as ScrollControlBase class instance. I found a bug in AQEnvironment.findClosestAncestor that did not always return Tree for this extended class, because it's sort method wasn't probably capable to sort hierarchies. I made a custom fix myself that makes use of flash.utils.describeType. This utility method returns an XML of which it is possible to extract all classes that the component extends in hierarchical order.

My replacement of the method:

/**
 *  Finds the closest ancestor to this object about which information was
 *  passed in the environment XML.
 *  @private
 */
private function findClosestAncestor(obj:Object):IAutomationClass
{
    var className:String = CustomAutomationClass.getClassName(obj);
    if (className in className2automationClass)
        return className2automationClass[className];

    var ancestors:XMLList = describeType(obj).descendants("extendsClass");
    for each (var ancestor:XML in ancestors) {

        var ancestorClassName:String =
            ancestor.attribute("type[).toString().replace(](:"), ".");
        var automationClass:IAutomationClass =
            className2automationClass[ancestorClassName];
        if (automationClass != null)
            return automationClass;
   }

   return null;

}

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Functional testing of Flex applications from Ruby

Pages