Hi, I need to click on the elements that are not in the accessibility hierarchy (not visible to screen readers). I can click by coordinates in XCUITest and UiAutomator2 drivers, but I couldn’t find the same functionality in Espresso driver. Is there any way I can click by coordinates using Espresso driver?
It seems like this script requires element id and the coordinates cannot be provided to it (only some presets relative to element’s rect can be provided)
Try look also inside internal driver tests.
Thanks, I was able to click by coordinates using this code:
val touchActions = listOf(
mapOf("type" to "pointerMove", "x" to x, "y" to y),
mapOf("type" to "pointerDown", "button" to 0),
mapOf("type" to "pointerUp", "button" to 0)
)
val actionsRoot = mapOf(
"type" to "pointer",
"id" to "id_tap",
"parameters" to mapOf(
"pointerType" to "touch"
),
"actions" to touchActions
)
driver.addCommand(HttpMethod.POST, "session/${driver.sessionId}/actions", "actions")
val command = Command(driver.sessionId, "actions", mapOf("actions" to listOf(actionsRoot)))
driver.commandExecutor.execute(command)
Do you plan to make it easier to click by coordinates? I think Espresso driver should have a command with this functionality