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.
Name | Value | Description |
---|---|---|
Latitude | -90 to 90 | Latitude 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 180 | Longitude 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.
- Public Continuous Testing Cloud - https://cloud.seetest.io/wd/hub/.
- Dedicated Continuous Testing Cloud environment - Your own domain. For example: https://company.experitest.com/wd/hub/
- On-premises Continuous Testing Cloud environment - Your designated URL. For example: https://company.com/wd/hub
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");