Edition Property

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

Description

Use the OSInfo.Edition property to get the edition of the operating system on which TestComplete is running.

Declaration

OSInfoObj.Edition

Read-Only Property String
OSInfoObj An expression, variable or parameter that specifies a reference to an OSInfo object

Applies To

The property is applied to the following object:

Property Value

The Sys.OSInfo.Edition property returns one of the following strings that indicate the Windows edition on the desktop computer:

  • Advanced Server
  • Business
  • Cluster Server
  • Compute Cluster
  • Datacenter
  • Datacenter Server
  • Enterprise
  • Home
  • Home Basic
  • Home Premium
  • Professional
  • Server
  • Server Business
  • Small Business Server
  • Small Business Server Premium
  • Standard
  • Starter
  • Web
  • Web Server
  • Ultimate

Remarks

To check whether the desktop computer is working on Windows XP Tablet PC Edition or on an operating system that includes Windows Media Center, use the Sys.OSInfo.TabletPC and Sys.OSInfo.MediaCenter properties, respectively.

Example

The following example obtains information on the operating system and posts it to the test log.

JavaScript, JScript

function OSInfoSample()
{
  var OSInfo = Sys.OSInfo;

  // Obtains information on the running operating system
  var Info = "Name: " + OSInfo.Name + " ";

  if (OSInfo.Windows64bit)
    Info += "64-bit version" + "\r\n";
  else
    Info += "32-bit version" + "\r\n";

  Info += "Edition: " + OSInfo.Edition + "\r\n" +
        "Service Pack Version: " + OSInfo.ServicePackVersion + "\r\n" +
        "Version: " + OSInfo.Version;

  // Posts the information to the test log
  Log.Message("Operating system information:", Info);
}

Python

def OSInfoSample():
  OSInfo = Sys.OSInfo
  
  # Obtains information on the running operating system
  Info = "Name: " + OSInfo.Name + " "
  
  if OSInfo.Windows64bit:
    Info = Info + "64-bit version" + "\r\n"
  else:
    Info = Info + "32-bit version" + "\r\n"
  
  Info = Info + "Edition: " + OSInfo.Edition + "\r\n" +\
    "Service Pack Version: " + OSInfo.ServicePackVersion + "\r\n" +\
    "Version: " + OSInfo.Version
  
  # Posts the information to the test log
  Log.Message("Operating system information:", Info)

VBScript

Sub OSInfoSample
  Dim OSInfo, Info
  Set OSInfo = Sys.OSInfo

  ' Obtains information on the running operating system
  Info = "Name: " & OSInfo.Name & " "

  If OSInfo.Windows64bit Then
    Info = Info & "64-bit version" & vbNewLine
  Else
    Info = Info & "32-bit version" & vbNewLine
  End If

  Info = Info & "Edition: " & OSInfo.Edition & vbNewLine & _
        "Service Pack Version: " & OSInfo.ServicePackVersion & vbNewLine & _
        "Version: " & OSInfo.Version

  ' Posts the information to the test log
  Log.Message "Operating system information:", Info
End Sub

DelphiScript

procedure OSInfoSample;
var OSInfo, Info;
begin
  OSInfo := Sys.OSInfo;

  // Obtains information on the running operating system
  Info := 'Name: ' + OSInfo.Name + ' ';

  if OSInfo.Windows64bit then
    Info := Info + '64-bit version' + #13#10
  else
    Info := Info + '32-bit version' + #13#10;

  Info := Info + 'Edition: ' + OSInfo.Edition + #13#10 +
        'Service Pack Version: ' + OSInfo.ServicePackVersion + #13#10 +
        'Version: ' + OSInfo.Version;

  // Posts the information to the test log
  Log.Message('Operating system information:', Info);
end;

C++Script, C#Script

function OSInfoSample()
{
  var OSInfo = Sys["OSInfo"];

  // Obtains information on the running operating system
  var Info = "Name: " + OSInfo["Name"] + " ";

  if (OSInfo["Windows64bit"])
    Info += "64-bit version" + "\r\n";
  else
    Info += "32-bit version" + "\r\n";

  Info += "Edition: " + OSInfo["Edition"] + "\r\n" +
        "Service Pack Version: " + OSInfo["ServicePackVersion"] + "\r\n" +
        "Version: " + OSInfo["Version"];

  // Posts the information to the test log
  Log["Message"]("Operating system information:", Info);
}

See Also

FullName Property
Name Property
Windows64bit Property
Version Property
ServicePackVersion Property
MediaCenter Property
TabletPC Property

Highlight search results