Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Make FunFX choose most extended class implementation for custom component

#9

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;

}

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

State: resolved
Milestone: none

Activity

  1. Peter Nicolai Motzfeldt
    Peter Nicolai Motzfeldt
    • State changed from new to resolved
    • Assigned user set to Peter Nicolai Motzfeldt

    Added it to master, will be in release 0.2.3

    March 27th, 2009 @ 02:21 PM

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.