How to hide mobile Keypad in Appium

Hello All,In this article, we are going to see the ways to hide mobile keypad in AppiumUse of hide mobile keypad:In automation testing, the keypad frequently pops up and we have to close it manually every time. In order to avoid this, the below syntax is used, so that the process continues without any delay or crash.

How to hide mobile Keypad in Appium
Steps to add capability for hide key pad:
  1. Open Eclipse and create Java file
  2. Create capability object like below
    DesiredCapabilities capabilities = new DesiredCapabilities();
  3. Set device name using the following syntax
    capabilities.setCapability("deviceName", "");
  4. Set platform Version using the following syntax
    capabilities.setCapability("platformVersion", "");
  5. Set platform Name using the following syntax
    capabilities.setCapability("platformName", "");
  6. Add the following capability for hidden keypad during testing time.
    capabilities.setCapability("unicodeKeyboard", true);
    capabilities.setCapability("resetKeyboard", true);
Example Code:
DesiredCapabilities capabilities = new DesiredCapabilities();
 capabilities.setCapability("deviceName", "");
 capabilities.setCapability("platformVersion", "");
 capabilities.setCapability("platformName", "Android");
 capabilities.setCapability("takesScreenshot", true);
 capabilities.setCapability("unicodeKeyboard", true);

Write Your Comment

Only registered users can write comments. Please, log in or register