0

i want to open "Choose input method" popup menu from settings application. Using monkeyrunner touch command, the screen is taped, while the menu is not opened.

Here is the reproduce steps:

  1. environment: emulator (android sdk 4.1)
  2. Go to System settings -> Launguage & input view
  3. try to tap the text "Default" using monkeyrunner touch command

python code:

    device = MonkeyRunner.waitForConnection(10, "emulator-5554")
    device.touch(83, 486, MonkeyDevice.DOWN_AND_UP)

Actually result:

  1. the screen is taped, but the popup menu is not opened. Also reproduced with tap the text "Launage".
  2. And i tried with android sdk 2.3.3 for this issue, the submenu for "Default" and "Language" could be opened.
  3. if executed the adb command "adb shell input tap 83 486" on sdk 4.1, the menu could be opened.

Any ideas for this issue?

4

1 回答 1

0

如果您使用 monkeyrunner 来打开系统设置 -> 语言和输入视图,那么您应该沿途放置一些 *MonkeyRunner.sleep(x) (其中 x 是以秒为单位的时间)。

这样,您将确保正确创建 UI 元素。如果您不放置 sleep(x) 语句,脚本将触摸/按下而没有任何延迟/超时。但是 android UI 需要一些时间来创建视图和其他元素并使其正常工作。

于 2012-09-03T09:08:36.730 回答