เราสามารถใช้ Espresso ในการเขียนจำลอง action ที่เราจะทำกับ view ที่ต้องการได้ ดังนี้
onView({component_selector}).perform({action})
ในกรณีที่ต้องการทำ action หลายอย่างต่อเนื่องกัน เราสามารถใช้คำสั่งดังนี้
onView({component_selector}).perform({action1}, {action2}, ..., {actionN})
โดยที่- {component_selector} เป็นคำสั่งสำหรับเลือก component ที่เราจะทำ action ด้วย
- {action} เป็น action ที่เราจะทำกับ component ที่เราเลือก