BrowserInfo Object

Applies to TestComplete 15.20, last modified on January 19, 2022

Description

The BrowserInfo object describes the browser the access to which TestComplete provides. It can be either one of the supported browsers installed on the current computer or a web browser running on a remote computer. The properties and methods of this object provide information about the browser and allow you to launch this browser from tests.

To get a local browser, use Browsers.Item. To get a remote browser, use the Browsers.RemoteItem property.

Members

Example

The following routine uses the properties and methods of Browsers and BrowserInfo objects to list all installed and supported browsers.

JavaScript, JScript

function ListBrowsers()
{
  var browser;
  
  for (var i=0; i < Browsers.Count; i++)
  {
    browser = Browsers.Item(i);
    Log.Message("Browser " + aqConvert.IntToStr(i) + " : " + browser.Description);
  }
}

Python

def ListBrowsers():
  for i in range (0, Browsers.Count-1):
    browser = Browsers.Item(i); 
    Log.Message("Browser " + aqConvert.IntToStr(i) + " : " + browser.Description);

VBScript

Sub ListBrowsers
  Dim browser
 
  For i = 0 To Browsers.Count-1
    Set browser = Browsers.Item(i)
    Log.Message("Browser " + aqConvert.IntToStr(i) + " : " + browser.Description)
  Next
End Sub

DelphiScript

procedure ListBrowsers;
var
  browser, i : OleVariant;
begin
  for i:=0 to Browsers.Count-1 do 
  begin
    browser := Browsers.Item(i);
    Log.Message('Browser ' + aqConvert.IntToStr(i) + ' : ' + browser.Description);
  end;
end;

C++Script, C#Script

function ListBrowsers()
{
  var browser;
  
  for (var i=0; i < Browsers["Count"]; i++)
  {
    browser = Browsers["Item"](i);
    Log["Message"]("Browser " + aqConvert["IntToStr"](i) + " : " + browser["Description"]);
  }
}

See Also

Classic Web Testing
Browsers Object

Highlight search results