question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

driver.hideKeyboard() doesn't work in appium 1.10.0-beta.5

See original GitHub issue

The problem

Calling driver.hideKeyboard() in test results in an error:

org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: The software keyboard cannot be closed

Environment

  • Appium version (or git revision) that exhibits the issue: 1.10.0-beta.5
  • Last Appium version that did not exhibit the issue (if applicable): 1.9.1
  • Desktop OS/version used to run Appium: macOS High Sierra (10.13.6)
  • Node.js version (unless using Appium.app|exe): 10.5.0
  • Mobile platform/version under test: Android
  • Real device or emulator/simulator: Emulator Pixel XL API 28
  • Appium CLI or Appium.app|exe: CLI

Details

N/A

Link to Appium logs

I’ll past just part of the appium log where hide_keyboard is called:

[HTTP] --> POST /wd/hub/session/ecd685b6-4964-4091-9893-9c4a67d9be35/appium/device/hide_keyboard
[HTTP] {}
[debug] [W3C (ecd685b6)] Calling AppiumDriver.hideKeyboard() with args: [null,null,null,null,"ecd685b6-4964-4091-9893-9c4a67d9be35"]
[debug] [ADB] Running '/Users/nenad/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell dumpsys input_method'
[debug] [ADB] Running '/Users/nenad/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell input keyevent 111'
[debug] [ADB] Running '/Users/nenad/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell dumpsys input_method'
[debug] [ADB] Running '/Users/nenad/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell dumpsys input_method'
[debug] [ADB] Running '/Users/nenad/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell dumpsys input_method'
[debug] [ADB] Running '/Users/nenad/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell dumpsys input_method'
[debug] [ADB] Running '/Users/nenad/Library/Android/sdk/platform-tools/adb -P 5037 -s emulator-5554 shell dumpsys input_method'
[debug] [W3C (ecd685b6)] Encountered internal error running command: Error: The software keyboard cannot be closed
[debug] [W3C (ecd685b6)]     at AndroidUiautomator2Driver.commands.hideKeyboard (/usr/local/lib/node_modules/appium/node_modules/appium-android-driver/lib/commands/general.js:82:13)
[HTTP] <-- POST /wd/hub/session/ecd685b6-4964-4091-9893-9c4a67d9be35/appium/device/hide_keyboard 500 2693 ms - 573
[HTTP] 
[HTTP] --> DELETE /wd/hub/session/ecd685b6-4964-4091-9893-9c4a67d9be35
[HTTP] {}

Code To Reproduce Issue [ Good To Have ]

N/A

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:14 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
ghostcommented, Dec 17, 2018

Verified that it works on appium v1.11.0-beta.2.

1reaction
ghostcommented, Nov 26, 2018

Did you try to execute adb shell input keyevent 111 when keyboard is shown? Does it hide the keyboard?

I’ve just tried it. Executing this command closes the keyboard in the emulator. When I downgrade appium to v1.9.1 and use emulator with Android 9.0 (API level 28) it works perfectly. Using appium server v1.10.0-beta.5 and an emulator with an older Android version e.g. Android 8.1 (API level 27) also works.

It seem that the problem here is using an emulator with the latest Android version (Android 9.0 API level 28). I probably did an update in Android Studio which introduced a new, fresh Android 9.0 image. Workaround for now is just to use a different emulator. Haven’t tried real devices yet. @saikrishna321 which emulator did you use?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Hide Keyboard - Appium
Edit this Doc Hide Keyboard. Hide soft keyboard. Example Usage. Java; Python; Javascript; Ruby; C#. driver.hideKeyboard();.
Read more >
Ios driver.hidekeyboard(); doesn't operate - Appium Discuss
hey i'm trying to close the keyboard with : driver.hidekeyboard(); ... os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.10.5', ...
Read more >
Click and hideKeyboard not working on Appium 1.6.3, iOS 10.2
Using: macOS Sierra 10.12.1 iPad mini 3 (real device) with iOS 10.2 Xcode 8.2 Appium 1.6.3 Appium java-client 4.1.2 Finding input fields in...
Read more >
Getting error while using method "driver.hide_keyboard"
Hi I am using Appium_lib version appium_lib-6.0.0 and appium version 1.3.4 Following is my test code with file name Appium_hide_keyboard.rb require ...
Read more >
Driver.hidekeyboard() issue - Support - Appium Discuss
Driver.hidekeyboard() issue · Support · Pallvi August 24, 2016, 2:17am #1. I am automation for android and application form is to register a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found