Mobile ActionsTap Action

Tap Action

When using a mobile app, a 'tap action' refers to the act of tapping on the screen of a mobile device with a finger or stylus. This action allows you to interact with elements on the app's user interface, such as buttons, links, or images, to trigger specific actions or functionalities. For example, tapping on a button in a mobile app might submit a form, navigate to a different screen, or add an item to a shopping cart. Similarly, tapping on a link will open a web page or display additional information.

Consider an example of removing all the items from the cart.

Following are the user actions:

  1. Open the Amazon App
  2. Login to Amazon account
  3. Check cart contents
  4. Navigate to cart screen
  5. Remove items from the cart
  6. Verify empty cart

Scenario: Remove items from the Amazon cart

Given The Amazon app is installed on the device

    And The user is logged in to their Amazon account

    And There are items present in the cart

    When The user opens the Amazon app

    And The user navigates to the cart screen

    And The user taps on each item in the cart to remove it

    Then The cart should be empty after removing all items. 

    And The user verifies that the cart is empty after removing all the items. 

Tap action usage example

The following code performs a tap action on a specific element using the TouchAction class in Appium. This enables interaction with the user interface of the mobile app. Make sure you have all the necessary prerequisites for run this command.

Tap action usage example using Appium framework with Python language: