GetVersion Method

Applies to TestComplete 15.42, last modified on September 08, 2022
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 this method to get version information for the Flash player plugin installed in a specified browser.

Declaration

FlashSettingsObj.GetVersion(Browser)

FlashSettingsObj An expression, variable or parameter that specifies a reference to a FlashSettings object
Browser [in]    Optional    Variant Default value: btIExplorer    
Result A FileVersionInfo object

Applies To

The method is applied to the following object:

Parameters

The method has the following parameter:

Browser

Specifies the browser to get the version of the Flash player plugin installed in it. The browser can be specified via the built-in constant or by the process name ("iexplore", "firefox").

If you want to specify a browser via the constant, you can use the following values:

Constant Value Description
btIExplorer -1 Microsoft Internet Explorer.
btFirefox -2 Mozilla Firefox.
btChrome -3 Google Chrome.
btEdge -6 Microsoft Edge.

Result Value

The object containing version information for the Flash player plugin installed in the given browser. If the method cannot obtain the plugin version, GetVersion returns null.

Example

The code below obtains the version of Flash player plugin in Internet Explorer:

JavaScript

function GetFlashVersion()
{
  var flashVer;

  // Obtain Flash player version information and post it to the test log
  if (!strictEqual(Options.FlashSettings.GetVersion(), null))
    {
      flashVer = Options.FlashSettings.GetVersion();
      Log.Message("Adobe Flash Player ver. " + flashVer.MajorPart + "." + flashVer.MinorPart + " is installed");
    }
  else 
    Log.Message("TestComplete cannot obtain Flash player version information");
}

JScript

function GetFlashVersion()
{
  var flashVer

  // Obtain Flash player version information and post it to the test log
  if (Options.FlashSettings.GetVersion() != null)
    {
      flashVer = Options.FlashSettings.GetVersion();
      Log.Message("Adobe Flash Player ver. " + flashVer.MajorPart + "." + flashVer.MinorPart + " is installed");
    }
  else 
    Log.Message("TestComplete cannot obtain Flash player version information");
}

Python

def GetFlashVersion():

  # Obtain Flash player version information and post it to the test log
  if not Options.FlashSettings.GetVersion() == None:
    flashVer = Options.FlashSettings.GetVersion()
    Log.Message("Adobe Flash Player ver. " + IntToStr(flashVer.MajorPart) + "." + IntToStr(flashVer.MinorPart) + " is installed")
  else:
    Log.Message("TestComplete cannot obtain Flash player version information")

VBScript

Sub GetFlashVersion
Dim flashVer

  ' Obtain Flash player version information and post it to the test log
  If (Not Options.FlashSettings.GetVersion Is Nothing) Then
    Set flashVer = Options.FlashSettings.GetVersion
    Log.Message "Adobe Flash Player ver. " & flashVer.MajorPart & "." & flashVer.MinorPart & " is installed"
  Else
    Log.Message "TestComplete cannot obtain Flash player version information"
  End If
  
End Sub

DelphiScript

procedure GetFlashVersion();
  var flashVer;
begin

  // Obtain Flash player version information and post it to the test log
  if not (Options.FlashSettings.GetVersion() = nil) then
  begin
    flashVer := Options.FlashSettings.GetVersion();
    Log.Message('Adobe Flash Player ver. ' + IntToStr(flashVer.MajorPart) + '.' + IntToStr(flashVer.MinorPart) + ' is installed');
  end
  else 
    Log.Message('TestComplete cannot obtain Flash player version information')
end;

C++Script, C#Script

function GetFlashVersion()
{
  var flashVer

  // Obtain Flash player version information and post it to the test log
  if (Options["FlashSettings"]["GetVersion"]() != null)
    {
      flashVer = Options["FlashSettings"]["GetVersion"]();
      Log["Message"]("Adobe Flash Player ver. " + flashVer.MajorPart + "." + flashVer.MinorPart + " is installed");
    }
  else 
    Log["Message"]("TestComplete cannot obtain Flash player version information");
}

See Also

FlashSettings Object Methods
FlashSettings Object
Testing Flash and Flex Applications with the Debug Version of Flash Player - Overview

Highlight search results