Flash Injector – Configuration for testing flex based applications using TestComplete
TestComplete needs scripting access of application internals, to test Flex applications. There are four ways to get access to Flash and Flex applications, which make them testable using TestComplete. Click on the links below to know more about each ways from smartbear website.
- FlashPlayer Debug Version
- Flex Client library
- Runtime loader helper utility
- Microsoft Active Accessibility (MSAA) engine
In this post we will discuss about the Flash Player Debug version approach, which is the easiest and quickest one among all these. In this approach we use the debug version of Flash Player with the FlashInjector.swf helper module shipped along with TestComplete. It is also known as the Flash Injector way.
This is quite simple and is a three step procedure.
Step 1: Installation of Debugger version of the Flash Player
- go to Adobe – Find Version – Flash Player page.
- find section “5. Troubleshoot Flash Player” – under “Find Flash Player version type and capabilities (Flash developers only)” verify you have debugger version installed (Debug Player = Yes).
- If Debug Player is No then it means you don’t have debug player installed. Install Debug player. Find the latest Flash Player version available for your operating system at section 3 and click on the appropriate link to install under section 4 Install Flash Player. Debugger versions are available to download here.
Step 2: Modify or create the mm.cfg
If the file mm.cfg is not created in the user profile folder, then create one adding the preloadswf parameter and initialize it with the fully-qualified path to the FlashInjector.swf module. By Default, this module is installed in the <TestComplete Installation Dir>\Open Apps\Flex foler.
– On Windows Vista, Windows 7, Windows Server 2008 and later operating systems, the typical path to this file is<System_Drive>\<Users>\<User_name>\mm.cfg.
– On Windows XP and Windows Server, the typical path is <System_Drive>\<Documents and Settings>\<User_name>\.
Add the preload parameter
On a 32-bit version of Windows:
PreloadSwf=C:\Program Files\Smartbear\TestComplete 9\Open Apps\Flex\FlashInjector.swf
On a 64-bit version of Windows:
PreloadSwf=C:\Program Files (x86)\Smartbear\TestComplete 9\Open Apps\Flex\FlashInjector.swf
Step 3: Add the FlashInjector.swf path to the list of trusted locations in Flash Player’s settings
Navigate to Global Flash Player Security Settings page,
Select Edit Location > Add Location from the drop down List for “Always trust files in these locations”
Enter the fully qualified name of the <TestComplete>\Open Apps\Flex directory and click Confirm.