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 |
|
The IP geolocation used for testing |
Return value
Boolean true/false
Examples
Java sample
Map<String, Object> params = new HashMap<>();
param.put("location", "Canada");
driver.executeScript("perfecto:geoLocation:set", param);
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.