emulateTapOnView

open fun emulateTapOnView(instrumentation: Instrumentation, activityTestRule: ActivityTestRule<?>, anchorView: View, offsetX: Int, offsetY: Int)(source)

Emulates a tap on a point relative to the top-left corner of the passed View. Offset parameters are used to compute the final screen coordinates of the tap point.

Parameters

instrumentation

the instrumentation used to run the test

anchorView

the anchor view to determine the tap location on the screen

offsetX

extra X offset for the tap

offsetY

extra Y offset for the tap