Run Method

Applies to TestComplete 15.47, last modified on January 20, 2023

Description

Launches the mobile browser emulator with the given browser profile (specified by the VirtualBrowserInfoObj object) and, optionally, opens a URL in the emulator.

Declaration

VirtualBrowserInfoObj.Run(URL, PageLoadWaitTime)

VirtualBrowserInfoObj An expression, variable or parameter that specifies a reference to a VirtualBrowserInfo object
URL [in]    Optional    String Default value: Empty string   
PageLoadWaitTime [in]    Optional    Integer Default value: -1   
Result None

Applies To

The method is applied to the following object:

Parameters

The method has the following parameters:

URL

The URL of the web page to open in the mobile browser emulator. Add the protocol (for example, http:// or https://) at the beginning of the URL.

Tip: You can copy the full URL from the address bar of the web browser in which the needed page is open.

If omitted, the mobile browser emulator will open a blank page (about:blank).

PageLoadWaitTime

The time, in milliseconds, to wait until the web page is loaded and ready to accept user input. The execution of the Run method finishes once the page is loaded completely or this timeout is reached.

If omitted or -1, the Run method uses the project’s Web page loading timeout.

Result Value

None.

Remarks

  • Google Chrome must not be running before the operation is run. If Chrome is running, the Run method opens a new tab in the running Chrome instance rather than starts the Chrome mobile emulator.

    Before calling the Run method, you can check if Chrome is running and close it if it is. To learn how to do this, see Check if Browser Is Running and Close Web Browsers.

  • After the mobile browser emulator is launched, the Aliases.browser object points to the browser emulator and provides access to the web pages that are open in it.

  • The Run method logs an event message if it succeeded and an error message if it failed.

Example

The following script line opens the SmartBear mobile web site in the iPad browser emulator:

JavaScript, JScript

VirtualBrowsers.Item("Apple iPad").Run("http://m.smartbear.com");

Python

VirtualBrowsers.Item["Apple iPad"].Run("http://m.smartbear.com");

VBScript

Call VirtualBrowsers.Item("Apple iPad").Run("http://m.smartbear.com")

DelphiScript

VirtualBrowsers.Item['Apple iPad'].Run('http://m.smartbear.com');

C++Script, C#Script

VirtualBrowsers["Item"]("Apple iPad")["Run"]("http://m.smartbear.com");

For more examples of the Run method usage, see the following topics:

See Also

Testing Mobile Web Applications Using Emulator
Launching Mobile Browser Emulator
VirtualBrowserInfo Object
Navigate Method
Run Virtual Browser Operation

Highlight search results