Table of contents
- How to set geolocation
- Points to note
How to set geolocation
Open the test run settings panel and click Edit on map in the Device Geolocation field on the Advanced settings tab.
A pop-up window will then appear. Set the latitude and longitude of geolocation by entering numerical values or clicking on the map.
During a test
Add a step from System > Set geolocation in the command list. From the Edit button on the step, you can edit its latitude/longitude. To set it, click on the map or enter a numerical value. Note that the Name field is for identification purposes only and does not affect the test itself.
Points to note
How to set iOS simulator geolocation in the local environment
If geolocation is set on the iOS simulator in the local environment, it is necessary to install an external library using the following procedure.
- Open the Mac terminal.
- Copy the following command:
brew install lyft/formulae/set-simulator-location
- Paste the copied command to the terminal, and press the Return key to run.
If you encounter "kCLErrorDomain error" in the iOS simulator or iOS cloud device
The following error may occur when executing the command depending on the application under test. In such case, geolocation set is still valid regardless of the error. Therefore, testing can continue using that geolocation after dismissing the message.
If you see an alert message in the browser
When the initial location is set or the Set geolocation command is used in browser testing, there is a case that an alert message about location unavailability is shown depending on the application under test. In such case, please dismiss the message and the location is still valid regardless of the alert.