InstallInjector Method

Applies to TestComplete 14.40, last modified on April 22, 2021

Description

Installs the FlashInjector module. The method adds a string that preloads the FlashInjector.swf movie to the Flash player configuration file (mm.cfg). If the file does not exist, the method creates it beforehand.

Declaration

FlashSettingsObj.InstallInjector()

FlashSettingsObj An expression, variable or parameter that specifies a reference to a FlashSettings object
Result None

Applies To

The method is applied to the following object:

Result Value

None.

Example

The code below checks whether the debug version of Flash player is installed in Internet Explorer. Then it installs the FlashInjector module (if needed), and posts the path to the Flash player's configuration file and file contents to the test log. Then it uninstalls the FlashInjector module:

JavaScript, JScript

function FlashInjectorInstall()
{
  // Check whether FlashInjector is already configured
  if (!Options.FlashSettings.IsInjectorInstalled)
    // Check whether Internet Explorer has the debug version of Flash player installed
    if (Options.FlashSettings.IsDebugVersion())
    {
      // Install the FlashInjector module
      Options.FlashSettings.InstallInjector();
      Log.Message("FlashInjector is successfully installed");

      // Post the path to the configuration file and its contents to the test log
      Log.Message("The path to the configuration file:" + Options.FlashSettings.DebugConfigPath);
      Log.Message("The configuration file contents:" + Options.FlashSettings.DebugConfigContents);

      // Uninstall the FlashInjector module
      Options.FlashSettings.UninstallInjector();
      Log.Message("FlashInjector is successfully uninstalled");
    }
    else

      Log.Message("Debug version of Flash player is not installed in Internet Explorer");
  else

    Log.Message("FlashInjector is already installed");
}

Python

def FlashInjectorInstall():

  # Check whether FlashInjector is already configured
  if not Options.FlashSettings.IsInjectorInstalled:
    # Check whether Internet Explorer has the debug version of Flash player installed
    if Options.FlashSettings.IsDebugVersion():
      # Install the FlashInjector module
      Options.FlashSettings.InstallInjector()
      Log.Message("FlashInjector is successfully installed")

      # Post the path to the configuration file and its contents to the test log
      Log.Message("The path to the configuration file:" + Options.FlashSettings.DebugConfigPath)
      Log.Message("The configuration file contents:" + Options.FlashSettings.DebugConfigContents)

      # Uninstall the FlashInjector module
      Options.FlashSettings.UninstallInjector()
      Log.Message("FlashInjector is successfully uninstalled")
    else:
      Log.Message("Debug version of Flash player is not installed in Internet Explorer")
  else:
    Log.Message("FlashInjector is already installed")

VBScript

Sub FlashInjectorInstall()

  ' Check whether FlashInjector is already configured
  If (Not Options.FlashSettings.IsInjectorInstalled) Then

    ' Check whether Internet Explorer has the debug version of Flash player installed
    If (Options.FlashSettings.IsDebugVersion) Then 
  
      ' Install the FlashInjector module
      Call Options.FlashSettings.InstallInjector()
      Log.Message "FlashInjector is successfully installed"

      ' Post the path to the configuration file and its contents to the test log
      Log.Message "The path to the configuration file:" + Options.FlashSettings.DebugConfigPath
      Log.Message "The configuration file contents:" + Options.FlashSettings.DebugConfigContents

      ' Uninstall the FlashInjector module
      Call Options.FlashSettings.UninstallInjector()
      Log.Message "FlashInjector is successfully uninstalled"

    Else
      Log.Message "Debug version of Flash player is not installed in Internet Explorer"
    End If 

  Else
    Log.Message "FlashInjector is already installed"
  End If

End Sub

DelphiScript

procedure FlashInjectorInstall();
begin

  // Check whether FlashInjector is already configured
  if (not Options.FlashSettings.IsInjectorInstalled) then
    // Check whether Internet Explorer has the debug version of Flash player installed
    if (Options.FlashSettings.IsDebugVersion()) then
    begin
      // Install the FlashInjector module
      Options.FlashSettings.InstallInjector();
      Log.Message('FlashInjector is successfully installed');

      // Post the path to the configuration file and its contents to the test log
      Log.Message('The path to the configuration file:' + Options.FlashSettings.DebugConfigPath);
      Log.Message('The configuration file contents:' + Options.FlashSettings.DebugConfigContents);

      // Uninstall the FlashInjector module
      Options.FlashSettings.UninstallInjector();
      Log.Message('FlashInjector is successfully uninstalled');
    end
    else
      Log.Message('Debug version of Flash player is not installed in Internet Explorer')
  else
    Log.Message('FlashInjector is already installed')
end;

C++Script, C#Script

function FlashInjectorInstall()
{
  // Check whether FlashInjector is already configured
  if (!Options["FlashSettings"]["IsInjectorInstalled"])

    // Check whether Internet Explorer has the debug version of Flash player installed
    if (Options["FlashSettings"]["IsDebugVersion"]())
    {
      // Install the FlashInjector module
      Options["FlashSettings"]["InstallInjector"]();
      Log["Message"]("FlashInjector is successfully installed");

      // Post the path to the configuration file and its contents to the test log
      Log["Message"]("The path to the configuration file:" + Options["FlashSettings"]["DebugConfigPath"]);
      Log["Message"]("The configuration file contents:" + Options["FlashSettings"]["DebugConfigContents"]);

      // Uninstall the FlashInjector module
      Options["FlashSettings"]["UninstallInjector"]()
      Log["Message"]("FlashInjector is successfully uninstalled");
    }

    else
      Log["Message"]("Debug version of Flash player is not installed in Internet Explorer");
  else
    Log["Message"]("FlashInjector is already installed");
}

See Also

FlashSettings Object Methods
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