Setting Security Permissions

Applies to TestComplete 15.47, last modified on January 20, 2023
Flash Player has reached end of life on December 31, 2020. Support for Flash and Flex applications is now deprecated in TestComplete and will be removed in a future release.

The information in this topic applies to web tests that locate web objects by using internal identification properties provided by TestComplete and run in local environments.

By default, the Flash Player does not allow the local SWF or FLV content to communicate with the Internet. To test Flash and Flex applications that reside on a local computer, you need to allow the communication. If the application is located in a local network or on the Internet, these actions are not required.

To allow your application to communicate with the Internet, you need to add the folder where the application resides to Flash Player's list of trusted locations. You can do this in one of the following ways:

  • Add the needed files and folders to the Trusted Locations list of the Flash/Flex Options dialog. When the recording or test run starts, TestComplete will automatically add these files and folders to Flash Player's list of trusted locations. For more information, see Project Properties - Flash/Flex Options.

-- or --

  • From your scripts using the AddTrustedLocation and RemoveTrustedLocation methods of the Options.FlashSettings object.

    JavaScript, JScript

    function FlashConfig()
    {
      // Add a file and a folder to the list of trusted locations and post the list to the test log
      Options.FlashSettings.AddTrustedLocation("c:\\WorkFolder");
      Options.FlashSettings.AddTrustedLocation("c:\\FlashApp\\FlashApp.swf");
      Log.Message(Options.FlashSettings.FlashTrustedLocations);

      // Remove a file from the list of trusted locations and post the list to the test log
      Options.FlashSettings.RemoveTrustedLocation("c:\\FlashApp\\FlashApp.swf");
      Log.Message(Options.FlashSettings.FlashTrustedLocations);
    }

    Python

    def FlashConfig():
      # Add a file and a folder to the list of trusted locations and post the list to the test log
      Options.FlashSettings.AddTrustedLocation("C:\\WorkFolder");
      Options.FlashSettings.AddTrustedLocation("C:\\FlashApp\\FlashApp.swf");
      Log.Message(Options.FlashSettings.FlashTrustedLocations);
    
      # Remove a file from the list of trusted locations and post the list to the test log
      Options.FlashSettings.RemoveTrustedLocation("C:\\FlashApp\\FlashApp.swf");
      Log.Message(Options.FlashSettings.FlashTrustedLocations);

    VBScript

    Sub FlashConfig()

      ' Add a file and a folder to the list of trusted locations and post the list to the test log
      Call Options.FlashSettings.AddTrustedLocation("c:\WorkFolder")
      Call Options.FlashSettings.AddTrustedLocation("c:\FlashApp\FlashApp.swf")
      Log.Message Options.FlashSettings.FlashTrustedLocations

      ' Remove a file from the list of trusted locations and post the list to the test log
      Call Options.FlashSettings.RemoveTrustedLocation("c:\FlashApp\FlashApp.swf")
      Log.Message Options.FlashSettings.FlashTrustedLocations

    End Sub

    DelphiScript

    procedure FlashConfig();
    begin
      // Add a file and a folder to the list of trusted locations and post the list to the test log
      Options.FlashSettings.AddTrustedLocation('c:\WorkFolder');
      Options.FlashSettings.AddTrustedLocation('c:\FlashApp\FlashApp.swf');
      Log.Message(Options.FlashSettings.FlashTrustedLocations);

      // Remove a file from the list of trusted locations and post the list to the test log
      Options.FlashSettings.RemoveTrustedLocation('c:\FlashApp\FlashApp.swf');
      Log.Message(Options.FlashSettings.FlashTrustedLocations);
    end;

    C++Script, C#Script

    function FlashConfig()
    {
      // Add a file and a folder to the list of trusted locations and post the list to the test log
      Options["FlashSettings"]["AddTrustedLocation"]("c:\\WorkFolder");
      Options["FlashSettings"]["AddTrustedLocation"]("c:\\FlashApp\\FlashApp.swf");
      Log["Message"](Options["FlashSettings"]["FlashTrustedLocations"]);

      // Remove a file from the list of trusted locations and post the list to the test log
      Options["FlashSettings"]["RemoveTrustedLocation"]("c:\\FlashApp\\FlashApp.swf");
      Log["Message"](Options["FlashSettings"]["FlashTrustedLocations"]);
    }

    Tip: To get the currently specified list of trusted locations, use the FlashTrustedLocations property. Note that this list does not include trusted locations that were 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 your application or the folder where your application resides. The specified file or folder will be added to the list of trusted locations which are allowed to access the Internet.

    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 via the MSAA Engine

Highlight search results