0

Need advise on how I can dismiss the keypad on iOS as I need to access an element below it.

I tried

driver.hideKeyboard();
driver.getKeyboard().sendKeys(Keys.RETURN);
driver.getKeyboard().sendKeys(Keys.CANCEL);
driver.getKeyboard().sendKeys(Keys.ENTER);

but all in vain.

I also tried scrollDown()

which is basically this code:

JavascriptExecutor js = (JavascriptExecutor) driver; HashMap scrollObject = new HashMap(); scrollObject.put("direction", "down"); js.executeScript("mobile: scroll", scrollObject);

and when I do this something weird thing like this happens keys 'e' gets typed.

Attaching GIF For your reference.

http://g.recordit.co/2WeVI3m6KM.gif

Any advise on this would be super great. Thanks.

  • Would you be able to share the Appium server logs from this test execution? We should see this endpoint in there if we're calling hideKeyboard: /wd/hub/session/:session_id/appium/device/hide_keyboard I'm curious as to what it's returning. here is it's doc for reference: https://github.com/appium/appium/blob/62700d3b1dc0edd985502cc1279747a782f3ee74/docs/en/commands/device/keys/hide-keyboard.md – jmp May 04 '18 at 02:05
  • assuming that we're using the most recent java client for appium, it would appear that we need to pass a string to the hideKeyboard command. https://github.com/appium/java-client/blob/master/src/main/java/io/appium/java_client/HidesKeyboardWithKeyName.java#L23-L32 could you try the tests again with the string "Next" or "123" and let me know the results? – jmp May 04 '18 at 02:16

0 Answers0