I have the following script for typing \'33\' into the Calculator, in Android, using UiAutomator. However, only the first \'3\' is accepted, the second press is entirely ig
Instead of just searching by text, try searching by the text and the class. Here is a sample method for doing so.
Uiobject getByTextAndClass(String text, String className) {
return new UiObject(new UiSelector().text(text).className(className));
}
And then if you are trying to call this method for the Calculator button with number 3 on it:
getByTextAndClass("3", android.widget.Button.class.getName()).click();
You can use the UiAutomatorViewer tool: {android-sdk}/tools/uiautomator.bat to check the classnames and other attributes of different UiObjects.
This works on my 4.2.2 devices, but I am downloading 4.1.2 to test it on there as well.
I tried it on a 4.1.2 AVD and it works on my Windows machine.