Set IP geolocation (FR)

Perfecto command: perfecto:geoLocation:set

Purpose

Sets the IP geolocation of the device under test (DUT) to allow for testing in any of the supported locations.

Parameters

Name

Type

Possible values

Description

location

String

Argentina | Australia | Austria | Belgium | Brazil | Bulgaria | Canada | CA-British Columbia | CA-Ontario| CA-Quebec | China | Colombia | Croatia | Cyprus | Czechia | Denmark | Dominican Republic | Estonia | Finland | France |Germany | Greece | Hungary | India | Indonesia | Ireland | Italy | Japan | Latvia | Lithuania | Luxembourg | Mexico | Netherlands | Norway | Peru | Poland | Romania | Portugal | S. Africa | S. Korea | Slovakia | Slovenia | Spain | Sweden | Switzerland | Turkey |UK | US-California | US-Colorado | US-East | US-Utah | US-Virginia| US-West

The IP geolocation used for testing

Return value

Boolean true/false

Examples

Copy

Java sample

Map<String, Object> params = new HashMap<>();
param.put("location", "Canada");
driver.executeScript("perfecto:geoLocation:set", param);
Copy

C# sample

Dictionary<String, Object> pars = new Dictionary<String, Object>();
pars.put("location", "Canada");
driver.executeScript("perfecto:geoLocation:set", pars);

Error messages

The following table lists the error numbers and messages that may occur.

Error number*

Error message

Description

170

Failed to set Geolocation.

Returned for an IP geolocation that does not exist

171

Failed to set Geolocation.

Returned if there was a problem retrieving the IP geolocation

173

Perfecto Connect & Geolocation are not supported concurrently.

Returned if you try work with IP geolocations while connected to Perfecto Connect

* Only relevant for web testing.