Interesting.  Looks like there Automation may not handle modules very well.  
One thing you can try to do is add the info.factory to 
SystemManager.allSystemManagers.  Something else might blow up though.  Please 
file a bug.

Alex Harui
Flex SDK Developer
Adobe Systems Inc.<http://www.adobe.com/>
Blog: http://blogs.adobe.com/aharui

From: [email protected] [mailto:[email protected]] On Behalf 
Of shameer.forflex
Sent: Friday, August 07, 2009 7:07 AM
To: [email protected]
Subject: [flexcoders] getSWFRoot error and Modules



Hi All,
I am loading modules into my Flex Application using ModuleManager and 
IModuleInfo interface.

var info:IModuleInfo = ModuleManager.getModule("url of module");
info.load();

All the module code are written in separate projects. I want to do automation 
testing with my flex application. I am using QTP for that. I am building the 
application with automation libs at compile time. The application works fine 
without automation libs. Now when I include the auto libs and run the 
application, click on a module and load another module, I am getting getSWFRoot 
null point error.

TypeError: Error #1009: Cannot access a property or method of a null object 
reference.
at 
mx.automation::AutomationManager$/getSWFRoot()[C:\work\flex\dmv_automation\projects\automation\src\mx\automation\AutomationManager.as:243]
at 
mx.automation::AutomationManager$/createDelegate()[C:\work\flex\dmv_automation\projects\automation\src\mx\automation\AutomationManager.as:270]
at 
mx.automation::AutomationManager$/addDelegates()[C:\work\flex\dmv_automation\projects\automation\src\mx\automation\AutomationManager.as:432]
at 
mx.automation::AutomationManager$/childAddedHandler()[C:\work\flex\dmv_automation\projects\automation\src\mx\automation\AutomationManager.as:206]
at flash.display::DisplayObjectContainer/addChildAt()
at 
mx.core::UIComponent/http://www.adobe.com/2006/flex/mx/internal::$addChildAt()
at 
mx.core::Container/http://www.adobe.com/2006/flex/mx/internal::rawChildren_addChildAt()
at mx.core::ContainerRawChildrenList/addChildAt()
at mx.core::Container/createBorder()
at mx.core::Container/styleChanged()
at mx.core::UIComponent/notifyStyleChangeInChildren()
at mx.core::Container/commitProperties()
at mx.core::UIComponent/validateProperties()
at mx.managers::LayoutManager/validateProperties()
at mx.managers::LayoutManager/doPhasedInstantiation()
at Function/http://adobe.com/AS3/2006/builtin::apply()
at mx.core::UIComponent/callLaterDispatcher2()
at mx.core::UIComponent/callLaterDispatcher()

Can anyone please help me in this?

Thanks in advance,
Shameer

Reply via email to