Description
The VirtualBrowserTestedApp
object corresponds to the mobile browser emulator in the project’s list of tested applications. It lets you get and set various emulator parameters, such as the browser to emulate, the URL to open in the emulator and so on. It also provides methods to launch and close the emulator from tests.
To obtain the VirtualBrowserTestedApp
object corresponding to a specific emulator instance, use any of the following:
-
TestedApps.AppName
, where AppName is the emulator’s name in the Tested Applications collection and in the Project Explorer. -
TestedApps.Items(Index)
, where Index is the emulator’s index (from 0) in the Tested Applications collection.
Notes
- The
VirtualBrowserTestedApp
object is provided for backward compatibility only. It is not intended for use in tests.To launch the mobile browser emulator in tests, use the Run Virtual Browser keyword test operation or the
VirtualBrowsers.Item(browser_name).Run
scripting method. -
A tested application corresponding to the mobile browser emulator is represented as a
VirtualBrowserTestedApp
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 emulator-specific parameters via theTestedApps.AppName.Params.ActiveParams
object.
Property List
Name | Description |
---|---|
BrowserArguments
|
String. Read-write. Gets or sets command-line arguments for the Chrome mobile emulator. |
BrowserExecutable
|
String. Read-only. Returns the fully-qualified path to Google Chrome. |
BrowserType
|
String. Read-only. Returns "Google Chrome". |
BrowserVersion
|
String. Read-only. The version of Google Chrome. |
ItemName
|
String. Read-write. The application’s name in the project’s list of tested applications. |
PageAddress
|
String. Read-write. The URL of the web page to open in the Chrome mobile emulator. |
ScreenHeight
|
Integer. Read-only. The emulated screen height (in CSS pixels) of the mobile browser specified by the VirtualBrowserName property. |
ScreenWidth
|
Integer. Read-only. The emulated screen width (in CSS pixels) of the mobile browser specified by the VirtualBrowserName property. |
UserAgent
|
String. Read-only. The user agent of the emulated mobile browser specified by the VirtualBrowserName property. |
VirtualBrowserName
|
String. Read-write. The mobile browser to emulate. |
Method List
Name | Description |
---|---|
Close
|
Attempts to close the mobile browser emulator normally and returns whether the attempt succeeded. |
Run
|
Attempts to run the mobile browser emulator and returns the Browser object that corresponds to the instance that was launched last. |
Terminate
|
Attempts to terminate the mobile browser emulator and returns whether the attempt succeeded. |
See Also
Testing Mobile Web Applications Using Emulator
About Tested Applications
Working With Tested Applications in Tests
TestedApps Object