This site is in read only mode. Please continue to browse, but replying, likes, and other actions are disabled for now.
21 / 27
Mar 2017

Hi All,

Is there any feature in Appium to hide android soft keyboard while entering data into App Text Fields via running automation script??

Kindly let me know.

Thanks

  • created

    Nov '15
  • last reply

    Apr '18
  • 26

    replies

  • 12.5k

    views

  • 14

    users

  • 22

    likes

  • 1

    link

appium_driver.hide_keyboard

This is in Ruby, but I suspect something similar is available in other supported languages

Just one more idea:

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

Using this, the soft keyboard will never open during tests. No need to hide it.

Hi Talemo

Thanks for the the another solution. I tried this but Soft keyboard is coming during test.

Kindly look into this.

Thanks

Really? Can you go to device settings -> Language & Input and change default keyboard to Appium Android Input Manager for Unicode and now tap on any EditText field?

For me no keyboard opens. If you do not have that option, then something happened on your test and appium keyboard didn't get installed.

Hi Talemo

At the very first run it was not working but after 2, 3 run its working, keyboard is suppressed.
I did not changed anything in Language and Input setting, but its working now.

Thanks for the help, it helped me to minimize my code.

:smile::smile:

2 months later

@ravikr42 : I have tried this one : capabilities.setCapability("unicodeKeyboard", true);
capabilities.setCapability("resetKeyboard", true);
But keyboard is always opening in the app ....

Have you tried this?

Hi @emnn_ayadi

For the very first run after setting capabilities you will see the keyboard coming up, but from the second run onward soft keyboard will not come, and internally it sets default keyword as "Appium Android Input Manager" as suggested by Talmo.

Just try running your scripts 2 to 3 times and soft keyword wont come.

Hope this will help.

Thanks
Ravi

@ravikr42 Yes, thank you very much it's ok now but i have a new problem that i couldn't find a solution yet !
Sendkeys didn't work as expected, it sends more than i give to it.
I'm using Appium to write test cases of an Android application, when i tap the following code

 public void EnterQuantity() {
            wd.findElement(By.xpath("//android.widget.LinearLayout[1]/android.widget.FrameLayout[1]/android.widget.LinearLayout[1]/android.widget.FrameLayout[1]/android.widget.RelativeLayout[1]/android.widget.ScrollView[1]/android.widget.LinearLayout[1]/android.widget.LinearLayout[3]/android.widget.LinearLayout[3]/android.widget.LinearLayout[1]/android.widget.EditText[1]")).sendKeys("1"); 
            }

I get 11 in Quantity field instead of 1. How can i reduce the speed of writing in order to be sure that only the number i gave is written not doubled.

Hi @Emna

Try using with some sleep time or use explicit wait. I guess it will work , if not please let me know.

Thanks

Hi @ravikr42 ,

capabilities.setCapability("newCommandTimeout","60");
wd.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);

i'm using this one and i do some thread.sleep(1000); before sendkeys("1")
But the problem this error occur not all the time let's say 70%
In Debug mode it's working fine .

29 days later

Hi Emna

can you tell me on which device you are running your scripts?

Thanks
Ravi

1 year later

Hi Telmo,

I used these two desired capabilities but still the keyboard is appearing in between test and about keyboard setting "Appium Android Input Manager" is not present in the keyboard list.

Please help with your suggestiion.

Thanks in advance!

@vjpatil

For the very first run after setting capabilities you will see the keyboard coming up, but from the second run onward soft keyboard will not come, and internally it sets default keyword as "Appium Android Input Manager"
Just try running your scripts 2 to 3 times and soft keyword wont come.

8 days later
10 days later

Hi Ravi,

Tried running the script multiple times but no success. Even checked the keyboard settings but not found "Appium Android Input Manager" in the keyboard list.

After trying mentioned ways on web. I just thought to try other way, even though it is not correct but I had spent more time with this issue I tried following shortcut method:

After getting soft keyboard I just refreshed the page.
webdriver.navigate().refresh();

Please let me know if you have any suggestion.

Thanks Ravi.

1 month later

Thanks Telmo,
It's really helpful to handle the unstable functionality of poping up of device keyboard.

3 months later

Thanks Telmo, it worked !!

2 months later

Why not simple select an other element and click() on it to hide the keyboard? Like this:
await driver.waitForElementByAccessibilityId(‘donglePin’, 20000).elementByAccessibilityId(‘donglePin’).setText(donglePin);
await driver.waitForElementByAccessibilityId(‘donglePinEntryIcon’, 20000).elementByAccessibilityId(‘donglePinEntryIcon’).click(); //keyboard is hidden now

1 month later
1 month later

Tnx for your answer
for python:
desired_caps[‘unicodeKeyboard’] = True
desired_caps[‘resetKeyboard’] = True

2 months later