aqEnvironment.GetWinVersionBuild Method

Applies to TestComplete 15.45, last modified on December 01, 2022

Description

Use the GetWinVersionBuild method to obtain the build number of the operating system that is installed on your computer and is currently running.

Declaration

aqEnvironment.GetWinVersionBuild()

Result Integer

Applies To

The method is applied to the following object:

Result Value

An integer value that indicates the build number of the currently running operating system.

Example

The following code demonstrates how you can obtain additional information about the operating system you are currently using.

JavaScript, JScript

function OSInformation()
{
 // Gets additional information about your operating system
 var AddInfo = aqEnvironment.GetWinAdditionalInfo();
 Log.Message("You are using Microsoft Windows operating system with the " + AddInfo + " installed");

 // Gets information about your operating system's major version
 var MajVer = aqEnvironment.GetWinMajorVersion();
 // Gets information about your operating system's minor version
 var MinVer = aqEnvironment.GetWinMinorVersion();
 // Gets information about your operating system's build number
 var Build = aqEnvironment.GetWinVersionBuild();
 // Posts the information about your system to the test log
 Log.Message("The OS version you are using is " + MajVer + "." + MinVer + "." + Build );
}

Python

def OSInformation():
  # Gets additional information about your operating system
  AddInfo = aqEnvironment.GetWinAdditionalInfo()
  Log.Message("You are using Microsoft Windows operating system with the " + AddInfo + " installed")
  # Gets information about your operating system's major version
  MajVer = aqEnvironment.GetWinMajorVersion()
  # Gets information about your operating system's minor version
  MinVer = aqEnvironment.GetWinMinorVersion()
  # Gets information about your operating system's build number
  Build = aqEnvironment.GetWinVersionBuild()
  # Posts the information about your system to the test log
  Log.Message("The OS version you are using is " + str(MajVer) + "." + str(MinVer) + "." + str(Build) )

VBScript

Sub OSInformation


 ' Gets additional information about your operating system
 AddInfo = aqEnvironment.GetWinAdditionalInfo()
 Call Log.Message("You are using Microsoft Windows operating system with the " + AddInfo + " installed")

 ' Gets information about your operating system's major version
 MajVerNum = aqEnvironment.GetWinMajorVersion()
 ' Converts the version number to a string
 MajVerStr = aqConvert.IntToStr(MajVerNum)

 ' Gets information about your operating system's minor version
 MinVerNum = aqEnvironment.GetWinMinorVersion()
 ' Converts the version number to a string
 MinVerStr = aqConvert.IntToStr(MinVerNum)

 ' Gets information about your operating system's build number
 BuildNum = aqEnvironment.GetWinVersionBuild()
 ' Converts the build number to a string
 BuildStr = aqConvert.IntToStr(BuildNum)

 ' Posts the information about your system to the test log
 Call Log.Message("The OS version you are using is " + MajVerStr + "." + MinVerStr + "." + BuildStr)

End Sub

DelphiScript

function OSInformation;
var AddInfo, MajVerNum, MajVerStr, MinVerNum, MinVerStr, BuildNum, Buildstr;
begin

 // Gets additional information about your operating system
 AddInfo := aqEnvironment.GetWinAdditionalInfo();
 Log.Message('You are using Microsoft Windows operating system with the ' + AddInfo + ' installed');

 // Gets information about your operating system's major version
 MajVerNum := aqEnvironment.GetWinMajorVersion();
 // Converts the version number to a string
 MajVerStr := aqConvert.IntToStr(MajVerNum);
 // Gets information about your operating system's minor version
 MinjVerNum := aqEnvironment.GetWinMinorVersion();
 // Converts the version number to a string
 MinVerStr := aqConvert.IntToStr(MinVerNum);
 // Gets information about your operating system's build number
 BuildNum := aqEnvironment.GetWinVersionBuild();
 // Converts the build number to a string
 BuildStr := aqConvert.IntToStr(BuildNum);
 // Posts the information about your system to the test log
 Log.Message('The OS version you are using is ' + MajVerStr + '.' + MinVerStr + '.' + BuildStr);

end;

C++Script, C#Script

function OSInformation()
{
 // Gets additional information about your operating system
 var AddInfo = aqEnvironment["GetWinAdditionalInfo"]();
 Log["Message"]("You are using Microsoft Windows operating system with the " + AddInfo + " installed");

 // Gets information about your operating system's major version
 var MajVer = aqEnvironment["GetWinMajorVersion"]();
 // Gets information about your operating system's minor version
 var MinVer = aqEnvironment["GetWinMinorVersion"]();
 // Gets information about your operating system's build number
 var Build = aqEnvironment["GetWinVersionBuild"]();
 // Posts the information about your system to the test log
 Log["Message"]("The OS version you are using is " + MajVer + "." + MinVer + "." + Build );
}

See Also

GetWinMajorVersion Method
GetWinMinorVersion Method
GetWinAdditionalInfo Method
Version Property

Highlight search results