Virtual keyboard is hiding the text and unable to close it

Hello Everyone,

While I’m giving some text virtual keyboard is hiding that text and unable to close the keyboard .Please see the below server error.
info: [debug] [BOOTSTRAP] [debug] Parsing selector: UiSelector().text(“com.infodat.selltis2:id/tvPassword”)

info: [debug] [BOOTSTRAP] [debug] UiSelector coerce type: class java.lang.String arg: “com.infodat.selltis2:id/tvPassword”
info: [debug] [BOOTSTRAP] [debug] Using: UiSelector[TEXT=com.infodat.selltis2:id/tvPassword]
info: [debug] Condition unmet after 20241ms. Timing out.
info: [debug] Responding to client with error: {“status”:7,“value”:{“message”:“An element could not be located on the page using the given search parameters.”,“origValue”:“No element found”},“sessionId”:“6913eae9-27fa-4990-acb0-16466a117cdd”}
info: ← POST /wd/hub/session/6913eae9-27fa-4990-acb0-16466a117cdd/element 500 20274.248 ms - 195
info: [debug] [BOOTSTRAP] [debug] Failed to locate element. Clearing Accessibility cache and retrying.
info: [debug] [BOOTSTRAP] [debug] Finding UiSelector().text(“com.infodat.selltis2:id/tvPassword”) using ANDROID_UIAUTOMATOR with the contextId: multiple: false
info: [debug] [BOOTSTRAP] [debug] Parsing selector: UiSelector().text(“com.infodat.selltis2:id/tvPassword”)
info: [debug] [BOOTSTRAP] [debug] UiSelector coerce type: class java.lang.String arg: “com.infodat.selltis2:id/tvPassword”
info: [debug] [BOOTSTRAP] [debug] Using: UiSelector[TEXT=com.infodat.selltis2:id/tvPassword]
info: [debug] [BOOTSTRAP] [debug] Returning result: {“status”:7,“value”:“No element found”}
info: → DELETE /wd/hub/session/6913eae9-27fa-4990-acb0-16466a117cdd {}

I’m thinking that because of keyboard above error is getting. Can anyone help me how to handle it?

What are you doing to try to close the keyboard?

Hi Will,
Thanks for the reply.
I was trying to enter username and password in my app but once i enter username android virtual keyboard is hiding password text field as i’m unable to view whether it is entering text or not. Because of the keyboard it will not clicking login button as well. so that i’m trying to close it.

Use caps

capabilities.setCapability("resetKeyboard", true);```

This will install a keyboard without any interface, and reset to the previous keyboard when execution completes.

I’m using capabilities.hidekeyboard() method for hiding keyboard , it is working perfectly but for each screen 2 to 3 times i’m writing hikekeyboard() method. I’ll try these two methods capabilities.setCapability(“unicodeKeyboard”, true);
capabilities.setCapability(“resetKeyboard”, true); to avoid overwrite problem.

Thanks.

It doesn’t work on android because the current UiAutomaterViewer can’t detect Keyboard. It’s similar to toast message. UiAutomaterViewer ver. 2 suppose to solve this issue and Appium devs were integrating those though not sure about the progress. You can read more about it here

Anyways I believe adding caps should solve your problem.

driver.hideKeyboard(); worked for me