Description
The BrowserTestedApp
object corresponds to a web application in the project’s Tested Applications collection. It lets you get or set information about the web application, such as its URL and the browser used to open this application. It also provides methods to launch and close the tested web application from tests.
To obtain the BrowserTestedApp
object corresponding to a specific web application, use any of the following:
-
TestedApps.AppName
, where AppName is the application's name in the Tested Applications collection and in the Project Explorer. -
TestedApps.Items(Index)
, where Index is the zero-based index of the application in the Tested Applications collection.
Remarks
-
Tested applications of the Web type are obsolete and are supported for backward compatibility only. To launch a web browser from tests, use the Run Browser keyword test operation or the
Browsers.Item(...).Run
scripting method. -
A tested web application is represented in tests as a
BrowserTestedApp
object only if the Use special runtime object option is selected for the application in the TestedApps editor. Otherwise, the application is represented by a genericTestedApp
object. In this case, you can set web-specific parameters via theTestedApps.AppName.Params.ActiveParams
object.
Members
Example
The following script defines a tested application for the SmartBear web site in Internet Explorer and then launches this application.
JavaScript, JScript
function Test()
{
var index = TestedApps.AddBrowser("Internet Explorer");
var app = TestedApps.Items(index);
app.PageAddress = "http://smartbear.com";
app.Run();
}
Python
def Test():
index = TestedApps.AddBrowser("Internet Explorer")
app = TestedApps.Items[index]
app.PageAddress = "http://smartbear.com"
app.Run()
VBScript
Sub Test
Dim app, index
index = TestedApps.AddBrowser("Internet Explorer")
Set app = TestedApps.Items(index)
app.PageAddress = "http://smartbear.com"
app.Run
End Sub
DelphiScript
procedure Test;
var app, index;
begin
index := TestedApps.AddBrowser('Internet Explorer');
app := TestedApps.Items(index);
app.PageAddress := 'http://smartbear.com';
app.Run;
end;
C++Script, C#Script
function Test()
{
var index = TestedApps["AddBrowser"]("Internet Explorer");
var app = TestedApps["Items"](index);
app["PageAddress"] = "http://smartbear.com";
app["Run"]();
}
See Also
Default Web Testing
About Tested Applications
Working With Tested Applications in Tests
TestedApps Object