Browsers.SystemDefaultBrowser Property

Applies to TestComplete 14.91, last modified on July 20, 2021

Description

Returns the system's default web browser.

Declaration

Browsers.SystemDefaultBrowser

Read-Only Property Integer

Applies To

The property is applied to the following object:

Property Value

An integer value denoting the family name of the default system browser on the computer. The following values are possible:

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

Example

The following routine uses the Browsers.SystemDefaultBrowser property to output the name of the system default browser to the Test Log.

JavaScript, JScript

function ShowSystemDefaultBrowser()
{
  var defaultBrowser;
  
    defaultBrowser = Browsers.Item(Browsers.SystemDefaultBrowser);
    Log.Message("The default browser is " + defaultBrowser.Description);
}

Python

def ShowSystemDefaultBrowser():
  defaultBrowser = Browsers.Item[Browsers.SystemDefaultBrowser]; 
  Log.Message("The default browser is " + defaultBrowser.Description);

VBScript

Sub ShowSystemDefaultBrowser
  Dim defaultBrowser
 
    Set defaultBrowser = Browsers.Item(Browsers.SystemDefaultBrowser)
    Log.Message("The default browser is " + defaultBrowser.Description)
End Sub

DelphiScript

procedure ShowSystemDefaultBrowser;
var
  defaultBrowser : OleVariant;
begin

    defaultBrowser := Browsers.Item(Browsers.SystemDefaultBrowser);
    Log.Message('The default browser is ' + defaultBrowser.Description);
end;

C++Script, C#Script

function ShowSystemDefaultBrowser()
{
  var defaultBrowser;
  
    defaultBrowser = Browsers["Item"](Browsers["SystemDefaultBrowser"]);
    Log["Message"]("The default browser is " + defaultBrowser["Description"]);
}

See Also

Browsers Object
CurrentBrowser Property

Highlight search results