Getting an error when passing latitude and longitude with the location capability

I’m doing native app automation in WebdriverIO, and I’m getting an error when passing latitude and longitude with the location capability.

The error is “Request failed with status 400 due to WebDriver Error: unknown error” with a response of “invalid argument.” How can I fix this?

Hi Toby,

The location capability in WebdriverIO expects latitude and longitude values in the Float data type. You should pass the values like this:

{
  "location": {
    "latitude": 45.424721,
    "longitude": -75.695000,
    "altitude": 0
  }
}

This should resolve the error you are encountering.