FlashTrustedLocations Property

Applies to TestComplete 15.63, last modified on April 10, 2024
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.

Description

Use FlashTrustedLocations to get the list of trusted locations specified by TestComplete.

Declaration

FlashSettingsObj.FlashTrustedLocations

Read-Only Property String
FlashSettingsObj An expression, variable or parameter that specifies a reference to a FlashSettings object

Applies To

The property is applied to the following object:

Property Value

A string that contains the full list of trusted locations that were added by TestComplete.

Remarks

The list of trusted locations specified by TestComplete is stored in the smartbear.cfg file that resides in this folder: <System_Drive>\<Users>\<User_name>\AppData\Roaming\Macromedia\Flash Player\#Security\FlashPlayerTrust.

Note that this setting is user-specific, that is, every Windows user has his or her own list of trusted locations.

Example

The code below adds a folder and a single file to the list of trusted locations and posts the list of trusted locations to the test log; then remove a file from the list and posts the resulting list of trusted locations to the test log:

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"]);
}

See Also

FlashSettings Object Properties
FlashSettings Object
Project Properties - Flash/Flex Options
Preparing Flash and Flex Applications for Testing with the Debug Version of Flash Player
Testing Flash and Flex Applications with the Debug Version of Flash Player - Overview

Highlight search results