I was seeking for test frameworks for Android UI automation and I stumbled upon UI Automator
and Espresso
and this is the part I am confused about
To get a quick notion how both things work let's give an example. Let's try to find and click a button with title "Start" on Lollipop using UIAutomator
and Espresso
:
device.findObject(new UiSelector().text("START")).click();
R.string.start
and wouldn't need to care how the string is actually rendered by the platform. You don't care if the view has textAllCaps=true
or it is ellipsized.
onView(withText(R.string.start)).perform(click());
TL:DR;
UIAutomator searches views in lower-level style than Espresso - via the Instrumentation mechanism and traversing the AccessibilityNodeInfo
tree of the view hierarchy. Espresso on its turn typically traverses the view hierarchy itself.