Editing Web Application Parameters

Applies to TestComplete 15.42, last modified on September 08, 2022
Adding web browsers and web applications to the Tested Applications collection is obsolete. Starting from version 14.0, it is no longer possible to add them to the collection directly.
To launch a web browser from tests, use the Run Browser keyword test operation or the Browsers.Item(...).Run scripting method.

You can change your tested application’s parameters not only in the TestedApps editor, but also from tests.

The way you access parameters of Web tested applications from tests depends on the Use special runtime object setting of the application in the TestedApps editor.

By default, this setting is enabled and you can get and set the application parameters directly via the TestedApps.AppName object. For example:

JavaScript, JScript

TestedApps.SmartBear.BrowserType = "Internet Explorer";
TestedApps.SmartBear.PageAddress = "http://smartbear.com";

Python

TestedApps.SmartBear.BrowserType = "Internet Explorer"
TestedApps.SmartBear.PageAddress = "http://smartbear.com"

VBScript

TestedApps.SmartBear.BrowserType = "Internet Explorer"
TestedApps.SmartBear.PageAddress = "http://smartbear.com"

DelphiScript

TestedApps.SmartBear.BrowserType := 'Internet Explorer';
TestedApps.SmartBear.PageAddress := 'http://smartbear.com';

C++Script, C#Script

TestedApps["SmartBear"]["BrowserType"] = "Internet Explorer";
TestedApps["SmartBear"]["PageAddress"] = "http://smartbear.com";

For more information on the available properties, see the BrowserTestedApp object description.

If the Use special runtime object setting is disabled (which is not recommended for all tests, except for legacy ones), you can access Web application parameters via the TestedApps.AppName.Params.WebParams property. For example:

JavaScript, JScript

TestedApps.SmartBear.Params.WebParams.BrowserExecutable = "C:\\Program Files\\Internet Explorer\\iexplore.exe";
TestedApps.SmartBear.Params.WebParams.PageAddress = "http://smartbear.com";

Python

TestedApps.SmartBear.Params.WebParams.BrowserExecutable = "C:\\Program Files\\Internet Explorer\\iexplore.exe"
TestedApps.SmartBear.Params.WebParams.PageAddress = "http://smartbear.com"

VBScript

TestedApps.SmartBear.Params.WebParams.BrowserExecutable = "C:\Program Files\Internet Explorer\iexplore.exe"
TestedApps.SmartBear.Params.WebParams.PageAddress = "http://smartbear.com"

DelphiScript

TestedApps.SmartBear.Params.WebParams.BrowserExecutable := 'C:\Program Files\Internet Explorer\iexplore.exe';
TestedApps.SmartBear.Params.WebParams.PageAddress := 'http://smartbear.com';

C++Script, C#Script

TestedApps["SmartBear"]["Params"]["WebParams"]["BrowserExecutable"] = "C:\\Program Files\\Internet Explorer\\iexplore.exe";
TestedApps["SmartBear"]["Params"]["WebParams"]["PageAddress"] = "http://smartbear.com";

For more information on the available properties, see the TestedAppWebParams object description.

See Also

About Tested Applications
Editing Desktop Application Parameters
Editing Mobile Application Parameters From Tests
Run Modes and Parameters
Getting and Setting Run Mode From Tests

Highlight search results