【发布时间】:2022-03-06 18:56:18
【问题描述】:
使用适用于 Android 的 uiautomator 我可以在文本字段中设置文本,但无法关闭键盘。在某些手机处于横向模式时,键盘会占据整个屏幕,必须点击“完成”才能退出该视图。如果我可以抑制键盘,那么我可以在横向和纵向上运行 uiautomator 而不会出现问题。
new UiObject(new UiSelector().text("Enter Text")).click();
new UiObject(new UiSelector().className("android.widget.EditText").instance(0)).setText("sample text");
// This is where I need to suppress the keyboard to view the app instead of just the keyboard itself.
new UiObject(new UiSelector().text("Submit")).click();
提前致谢。
【问题讨论】:
-
你的问题是什么?
标签: android android-uiautomator