Browser go to (FR)

Perfecto Command

mobile:browser:goto

Purpose

Opens the browser application and browses to the specified location. This is done with a direct native command to the device OS, and not with navigation.

No validation is performed. The green success status confirmation within the execution report does not validate that the browser was opened; rather, it validates that the native command request was successfully received by the device OS.

The URL page will not refresh if the browser go to function is used with the same URL consecutively. To ensure that the URL page is reloaded, use the Browser open function followed by the Browser go to function.

Parameters

Name

Value

Default

Description

deviceID*

   

The device for this command.

url*

   

The specified URL.

waitForPageLoad

 

false

Selects whether command should execute synchronously - waiting for the page to load before returning control. Default is to work asynchronously, and return immediately after registering the request.

automation

simulated (Default)

os (OS)

chrome ()

safari ()

native ()

default

The automation mode for web applications.

Default - open the browser set as default on the device

OS - DOM object supported browser. Safari for iOS, Chrome for Android.

Select the OS option to use the real DOM on native browsers. When using this option, the system will ensure that only one tab is opened.

* Mandatory parameter

Return Value

"OK" if successful, "Failed" otherwise

Exceptions

None

Examples

Copy

Java sample

//declare the Map for script parameters
Map<String, Object> params2 = new HashMap<>();
params2.put("url", "https://www.phys.org");
String res2 = (String) driver.executeScript("mobile:browser:goto", params2);
Copy

C# sample

//declare the Map for script parameters
Dictionary<String, Object> pars = new Dictionary<String, Object>();

pars.Add("url", "https://www.phys.org");
String res = (String) driver.ExecuteScript("mobile:browser:go", pars);