Skip to main content

SetLocation

Description

The command lets you set the location of the device. This lets you test geolocation-based applications. It is assumed that you have preconfigured the device for location testing. This command will fail the current test in case the location couldn't be set.

NameValueDescription
Latitude-90 to 90Latitude value in decimal degrees, ranging from -90 to 90.

Positive values represent latitudes north of the equator while negative values represent latitudes south of the equator.
Longitude-180 to 180Longitude value in decimal degrees, ranging from -180 to 180.

Positive values represent longitudes east of the prime meridian while negative values represent longitudes west of the prime meridian.
info

The location set using SetLocation command can be cleared using ClearLocation.

Usage

info

Replace <server> with the appropriate URL.

SetLocation of Device

DesiredCapabilities dc = new DesiredCapabilities();
driver = new AndroidDriver(new URL("<server>"), dc);
seetest = new SeeTestClient(driver);
dc.setCapability(MobileCapabilityType.UDID, "deviceid");

...
...
// This command sets location.
seetest.setLocation("20.593684", "78.962880");