androidpython-2.7dumpandroid-uiautomatorandroidviewclient

In android view client I'm not able to capture qwerty keyboard in message


I'm using android version 4.4.2 and python 2.7 for UI automation.

when I tried to capture view using UI automator/culebra/dump, I'm not able to capture QWERTY keypad view. Please help me on this

I need to touch and type on qwerty keypad and I should be able to type alpha-numeric text and smileys. Also once typed, you should verify if what is displayed on the screen is what you intended to type.

Thanks in advance.


Solution

  • As another answer mentions, AndroidViewClient using UiAutomator back-end cannot dump the content of any other than the main window, thus why the Input Method window is not accessible.

    AndroidViewClient supports other back-ends, like ViewServer. You can take a look at the examples provided with AndroidViewClient source, particularly at dump-all-windows.py, which shows how to dump the content of other windows not just the main one. Even though you can get most of the Views in the keyboard, the actual keys are handled internally by com.android.inputmethod.keyboard.internal.PreviewPlacerView and thus you won't be able to interact with them individually.

    Remember that you can always touch the keys using their coordinates like in

      if device.isKeyboardShown():
        device.touch(400, 950)
    

    that would touch the G on a 768x1280 emulator. But this is device dependent.