Best Practices for Tap Command

This section defines the recommended practices for writing stable and unambiguous tap commands in Drizz. Because tapping is one of the most frequently used interactions in mobile automation, clarity and precision in describing the intended UI target are essential for consistent execution. These guidelines help ensure that tap commands resolve accurately across different layouts, repeated elements, dynamic screens and scenarios where text labels or icons may vary. By following these practices, authors can significantly improve reliability, reduce ambiguity, and create tests that behave deterministically across devices and OS versions.

  1. Use exact text when available Write the target clearly with precision.

    1. Example: Tap ADD

    Prefer exact matches over descriptive phrases.

  2. Use positional referencing when multiple identical labels exist

    1. Example: Tap the first "ADD"

    2. Example: Tap on "Continue" at the bottom of the page

    Always specify direction to avoid ambiguity.

  3. Use contextual referencing when the same text appears across sections

    1. Example: Tap "Apply" in coupon section

    2. Example: Tap "Edit" under Profile

    3. Example: Tap on "Blue icon" under Profile

    Helps Drizz reliably identify the correct instance.

  4. Use icon/colour references when the element has no text

    1. Example: Tap the search icon

    2. Example: Tap ton the red button

    Use icon or colour based terms only when no text label is associated.

  5. Avoid phrase-based descriptions when text labels exist

    1. Prefer: Tap Login

    2. Not preferred: Tap the login button on the lower half of the page

  6. Always validate after a critical tap

    Example:

    Type username as xyz@123 Type password as pass@123 Tap on login CTA Validate Homepage is visible

Last updated

Was this helpful?