Applies to TestComplete 14.30, last modified on November 21, 2019

After you install the debug version of Adobe Flash Player for your web browser, configure it to preload the FlashInjector.swf module and add the module folder to the list of trusted locations.

You can configure Adobe Flash Player –

  • Automatically, at the start of the recording and test run.

  • Manually, from the project's Flash/Flex Options dialog.

  • From your scripts, by using the properties and methods of the Options.FlashSettings object.

  • Manually, by editing Flash Player config file (mm.cfg).

You configure it only once. After you do this, you can test any Flash or Flex application.

1. Configure your Flash Player to preload the FlashInjector module

You can do this in one of the following ways –

  • You can command TestComplete to access your Flash Player settings and configure Flash Player to preload the FlashInjector at the beginning of each test recording session or test run:

    1. In TestComplete, open the Properties page of your project and then select Open Applications | Flash / Flex in the list in the left part of the page.

    2. Select the Install FlashInjector at the beginning of the test recording and playback check box.

    3. Save the changes.

  • Manually, from the TestComplete IDE:

    1. In TestComplete, open the Properties page of your project and then select Open Applications | Flash / Flex in the list in the left part of the page.

    2. Click Install FlashInjector Now.

  • From your scripts using the Options.FlashSettings.InstallInjector method:

    JavaScript, JScript

    Options.FlashSettings.InstallInjector();

    Python

    Options.FlashSettings.InstallInjector();

    VBScript

    Call Options.FlashSettings.InstallInjector

    DelphiScript

    Options.FlashSettings.InstallInjector();

    C++Script, C#Script

    Options["FlashSettings"]["InstallInjector"]();

– or –

  • Manually, by modifying the mm.cfg file that contains the settings of the debug version of Flash Player:

    1. Locate the mm.cfg file:

      • For Google Chrome, the mm.cfg file location is –

        <System_Drive>\<Users>\<User_name>\AppData\Local\Google\Chrome\User Data\Default\Pepper Data\Shockwave Flash\System\mm.cfg

      • For other web browsers, the location of the mm.cfg file is specified as %HOMEDRIVE%\%HOMEPATH%. By default, the mm.cfg file resides in your user profile folder –

        - On Windows 7, Windows Server 2008 R2, Windows Vista and later operating systems, the typical path to this file is <System_Drive>\<Users>\<User_name>\mm.cfg.

        - On Windows XP and Windows Server 2003, the typical path is <System_Drive>\<Documents and Settings>\<User_name>\.

        The path to the mm.cfg file can differ from the default one on your computer. Check the value of the FlashSettings.DebugConfigPath property to find out where the Flash Player configuration file resides:

        JavaScript, JScript

        Log.Message(Options.FlashSettings.DebugConfigPath);

        Python

        Log.Message(Options.FlashSettings.DebugConfigPath);

        VBScript

        Log.Message(Options.FlashSettings.DebugConfigPath)

        DelphiScript

        Log.Message(Options.FlashSettings.DebugConfigPath);

        C++Script, C#Script

        Log["Message"](Options["FlashSettings"]["DebugConfigPath"]);

    2. Open the file in any text editor, for example, in Notepad.

    3. Add the PreloadSwf parameter to the mm.cfg file and set it to the fully-qualified path to the FlashInjector.swf module. By default, this module is installed in the <TestComplete>\Open Apps\Flex folder. For instance, you can use the following settings:

      On a 32-bit version of Windows:

      PreloadSwf=C:\Program Files\SmartBear\TestComplete 14\Open Apps\Flex\FlashInjector.swf


      On a 64-bit version of Windows:

      PreloadSwf=C:\Program Files (x86)\SmartBear\TestComplete 14\Open Apps\Flex\FlashInjector.swf

      Note: If you use a web browser other than Google Chrome, you can use the Options.FlashSettings.DebugConfigContents property to get and modify the contents of the mm.cfg file.

    Important Notes

    • The mm.cfg file can be created automatically by the Flash Player installation program or when TestComplete configures Flash Player to preload the FlashInjector module.

      If the file is not created, create the file manually at the following location –

      • For Google Chrome –

        <System_Drive>\<Users>\<User_name>\AppData\Local\Google\Chrome\User Data\Default\Pepper Data\Shockwave Flash\System\mm.cfg

      • For other web browsers –

        <System_Drive>\<Users>\<User_name>\mm.cfg

    • Some add-ons (for example, the Flash Debugger add-on) can overwrite the mm.cfg file, which may impede testing of Flash and Flex applications. We recommend that you disable add-ons while testing Flash and Flex applications with the debug version of Flash Player. In particular, if the Flash Debugger add-on is installed on your computer:
      1. Disable or uninstall the add-on. For more information on how to do this, see http://support.mozilla.com/en-US/kb/Uninstalling%20add-ons.

      2. Open Flash Debugger preferences window and click Submit. This will recreate the mm.cfg file.

      3. After that, add the PreloadSwf parameter to the mm.cfg file as it was described above.

2. Add the FlashInjector module folder to the list of trusted locations

Add the fully-qualified name of the <TestComplete>\Open Apps\Flex folder to the list of trusted locations:

  • Configure TestComplete to add the appropriate folder to the list of trusted locations automatically:

    1. In TestComplete, open the Properties page of your project and then select Open Applications | Flash / Flex in the list on the left.

    2. Add the <TestComplete>\Open Apps\Flex folder to the Trusted Locations list.

    When recording or test run starts, TestComplete will automatically add the specified folder to the Flash Player list of trusted locations.

– or –

  • In your script test, use the Options.FlashSettings.AddTrustedLocation method:

    JavaScript, JScript

    function FlashConfig()
    {
      // Add FlashInjector folder to the list of trusted locations and post the list to the test log
      Options.FlashSettings.AddTrustedLocation(aqEnvironment.GetEnvironmentVariable("ProgramFiles") + "\\SmartBear\\TestComplete 14\\Open Apps\\Flex");
      Log.Message(Options.FlashSettings.FlashTrustedLocations);

      …

    }

    Python

    def FlashConfig():
      # Add the FlashInjector folder to the list of trusted locations and post the list to the test log
      Options.FlashSettings.AddTrustedLocation(aqEnvironment.GetEnvironmentVariable("ProgramFiles") + "\\SmartBear\\TestComplete 14\\Open Apps\\Flex");
      Log.Message(Options.FlashSettings.FlashTrustedLocations);
      # ...

    VBScript

    Sub FlashConfig()

      ' Add FlashInjector folder to the list of trusted locations and post the list to the test log
      Call Options.FlashSettings.AddTrustedLocation(aqEnvironment.GetEnvironmentVariable("ProgramFiles") + "\SmartBear\TestComplete 14\Open Apps\Flex")
      Log.Message Options.FlashSettings.FlashTrustedLocations

      …

    End Sub

    DelphiScript

    procedure FlashConfig();
    begin
      // Add FlashInjector folder to the list of trusted locations and post the list to the test log
      Options.FlashSettings.AddTrustedLocation(aqEnvironment.GetEnvironmentVariable('ProgramFiles') + '\SmartBear\TestComplete 14\Open Apps\Flex');
      Log.Message(Options.FlashSettings.FlashTrustedLocations);

      …

    end;

    C++Script, C#Script

    function FlashConfig()
    {
      // Add FlashInjector folder to the list of trusted locations and post the list to the test log
      Options["FlashSettings"]["AddTrustedLocation"](aqEnvironment.GetEnvironmentVariable("ProgramFiles") + "\\SmartBear\\TestComplete 14\\Open Apps\\Flex");
      Log["Message"](Options["FlashSettings"]["FlashTrustedLocations"]);

      …

    }

    Tip: To get the current list of trusted locations, use the Options.FlashSettings.FlashTrustedLocations property. This list does not include trusted locations specified manually in the Control Panel settings.

-- or --

  • You can do this manually from the Control Panel:

    1. Open the Control Panel | System and Security | Flash Player applet. You can also right-click somewhere within any Flash or Flex movie open in a web browser (or in the Flash Player standalone) and choose Global Settings from the context menu.

    2. In the ensuing Flash Player Settings Manager, switch to the Advanced tabbed page and click the Trusted Location Settings button. This will invoke the Trusted Location Settings dialog.

    3. In the Trusted Location Settings dialog, select Add and specify the path to the <TestComplete>\Open Apps\Flex folder and click Confirm.

      Note that on 32-bit versions of Windows the default path is C:\Program Files\SmartBear\TestComplete 14\Open Apps\Flex while on 64-bit versions of Windows the path is C:\Program Files (x86)\SmartBear\TestComplete 14\Open Apps\Flex.

      This will add the folder containing the FlashInjector.swf file to the list of trusted locations.

    Note: If you have a Flash Player version earlier than 11, use the online version of the Adobe Flash Player Settings Manager to specify the list of trusted locations. To open the Global Security Settings panel where you can specify the list of trusted locations, navigate to the following URL:

    http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html

See Also

Preparing Flash and Flex Applications for Testing with the Debug Version of Flash Player

Highlight search results