Navigate Method

Applies to TestComplete 15.63, last modified on April 23, 2024

Description

The Navigate method opens the specified URL in the running instance of the mobile browser emulator. You typically call this method applied to the VirtualBrowsers.CurrentBrowser object (see the example below).

Declaration

VirtualBrowserInfoObj.Navigate(URL, WaitTime)

VirtualBrowserInfoObj An expression, variable or parameter that specifies a reference to a VirtualBrowserInfo object
URL [in]    Required    String    
WaitTime [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. 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.

WaitTime

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

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

Result Value

None.

Remarks

  • The Chrome mobile emulator must be previously launched by using the VirtualBrowsers.Item(browser_name).Run method in order for the Navigate method to execute successfully.

  • The Navigate method logs an event message if it opened the web page successfully, and an error otherwise.

Example

The following example launches the Samsung Galaxy S3 emulator and then opens a web site in it:

JavaScript, JScript

function Test()
{
  VirtualBrowsers.Item("Samsung Galaxy S3").Run();
  VirtualBrowsers.CurrentBrowser.Navigate("http://m.smartbear.com");
}

Python

def Test():
  VirtualBrowsers.Item["Samsung Galaxy S3"].Run();
  VirtualBrowsers.CurrentBrowser.Navigate("http://m.smartbear.com");

VBScript

Sub Test
  VirtualBrowsers.Item("Samsung Galaxy S3").Run
  VirtualBrowsers.CurrentBrowser.Navigate "http://m.smartbear.com"
End Sub

DelphiScript

procedure Test;
begin
  VirtualBrowsers.Item('Samsung Galaxy S3').Run;
  VirtualBrowsers.CurrentBrowser.Navigate('http://m.smartbear.com');
end;

C++Script, C#Script

function Test()
{
  VirtualBrowsers["Item"]("Samsung Galaxy S3")["Run"]();
  VirtualBrowsers["CurrentBrowser"]["Navigate"]("http://m.smartbear.com");
}

See Also

Testing Mobile Web Applications Using Emulator
VirtualBrowserInfo Object
Run Method
CurrentBrowser Property

Highlight search results