title: UI automation -- iOS press enter key
body: <p>I am trying to automate pressing the ENTER key upon searching for a text</p>
  
  <pre><code>public void pressEnter() {
        ((IOSDriver) driver).getKeyboard().sendKeys(Keys.RETURN);
  }
  </code></pre>
  
  <p>I'm getting this error when trying to automate pressing the Enter key. What's wrong here? This used to work. I also tried Keys.ENTER and it gave the same error.</p>
  
  <p>java-client version: 6.0.0</p>
  
  <pre><code>org.openqa.selenium.UnsupportedCommandException: sendKeysToActiveElement
  Build info: version: '3.12.0', revision: '7c6e0b3', time: '2018-05-08T14:04:26.12Z'
  System info: host: 'DESKTOP-JPLMVQR', ip: 'my.ip.address.here', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.13.4', java.version: '1.8.0_152-release'
  Driver info: driver.version: IOSDriver
  
      at org.openqa.selenium.remote.http.AbstractHttpCommandCodec.encode(AbstractHttpCommandCodec.java:218)
      at org.openqa.selenium.remote.http.AbstractHttpCommandCodec.encode(AbstractHttpCommandCodec.java:117)
      at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:152)
      at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:218)
      at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:543)
      at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:42)
      at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
      at io.appium.java_client.ios.IOSDriver.execute(IOSDriver.java:1)
      at org.openqa.selenium.remote.RemoteExecuteMethod.execute(RemoteExecuteMethod.java:35)
      at org.openqa.selenium.remote.RemoteKeyboard.sendKeys(RemoteKeyboard.java:38)
      at com.example.base.BaseTest.pressEnter(BaseTest.java:98)
      at com.example.tests.SearchTests.verifySearch_RedirectToDetail(SearchTests.java:97)
  </code></pre>