ES preSSO - 的TypeText不工作 [英] Espresso - typeText not working
问题描述
我想输入一个EditText里面的一些文字:
I'm trying to type some text inside an EditText:
public void testSearch() {
onView(withId(R.id.titleInput)).perform(typeText("Engineer"));
onView(withId(R.id.titleInput)).check(matches(withText("Engineer")));
}
我看到的EditText越来越焦点,但没有任何反应。没有文字键入。
结果
我想这是一个手机和一个仿真器上 - 同样的结果。
I see the EditText is getting focus, but nothing happens. No text is typed.
I tried this on a phone and an emulator - same result.
推荐答案
看起来像我想通了这个问题。它与硬件VS软件键盘的事情。
Looks like I figured out the issue. It had to do with hardware vs software keyboard.
对于仿真器:
进入设置 - >语言和放大器;输入 - >切换默认输入到样品软键盘。
Go to Settings -> Language & Input -> switch the Default Input to Sample Soft Keyboard.
对于电话:
安装Play商店中的软件键盘,并切换到它。看来,有些手机的原生键盘不起作用。
Install a software keyboard from the Play store and switch to it. It appears that the native keyboards of some phones do not work.
现在的工作。
这篇关于ES preSSO - 的TypeText不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!