Skip to main content

Mobile Test Actions

Mobile Test Actions in DevAssure provide a comprehensive set of touch and gesture interactions to simulate real user behaviors on mobile devices. These actions are configurable, and with the flexibility of choosing elements, durations, and distances, they enable precise and controlled testing across applications.

Touch Actions:

ActionDescription
Tap on (Element))Simulates a single tap on the specified element.
Tap on (Element) and hold for (duration) milliseconds)simulates a long press on the specified element for the given duration.
Pinch IN on (Element))Simulates a pinch-in gesture on the specified element.
Pinch OUT on (Element)Simulates a pinch-out gesture on the specified element.
Double tap on (Element))Simulates a double-tap on the specified element.
Click on (Element))Simulates a click on the specified element.
Scroll vertically on (Element))simulates a vertical scroll on the specified element.
Scroll horizontally on (Element))simulates a horizontal scroll on the specified element.
Swipe on (Element) for distance (x), (y) and hold for (duration) millisecond)Simulates a swipe gesture on the specified element.

Input

ActionDescription
Input value (value) in (Element)Simulates typing a specified value into the targeted element.

Element

ActionDescription
Wait for (Element) to be presentWaits until the specified element is present in the DOM.
Wait for (Element) to be present within (duration) millisecondsWaits for the specified element to be present in the DOM within a given time frame.
Wait for (Element) to be visibleWaits until the specified element becomes visible on the screen.
Wait for (Element) to be visible within (duration) millisecondsWaits for the specified element to become visible within a given time frame.
Wait for (Element) to disappearWaits until the specified element is no longer visible on the screen.
Wait for (Element) to disappear within (duration) millisecondsWaits for the specified element to disappear from the screen within a given time frame.
Get (n)th instance of ElementFetches the nth instance of a specified element.
Is (Element) present within (duration) millisecondsChecks if the specified element exists on the web page within the given time duration.
Get text of ElementRetrieves the text content of the specified element.
Get Count of ElementCounts the occurrences of the specified element on the web page.
Is (Element) visible within (duration) millisecondsChecks if the specified element becomes visible within a given time frame.

Validation

ActionDescription
Verify if (Element) is visibleChecks whether the specified element is visible on the web page.
Verify if count of (Element) is (n)Verifies if the number of occurrences of the specified element matches the expected count.
Verify if text of (Element) is equal to (text)Checks if the text content of the specified element matches the expected text.
Take Screenshot (label)Captures a screenshot of the current visual state of the application and saves it with a label.

WebView

ActionDescription
Switch to Web ViewSwitches the context of the mobile test to the Web View, enabling interaction with web-based content within a mobile application
Switch to Native AppSwitches the context of the mobile test back to the Native App, enabling interaction with native mobile application elements.

Tap on (Element)

Simulates a single tap on the specified element.
  • Usage: Useful for interactions that require a quick tap on buttons or selectable items.

    Tap on mobile > login
  • Arguments:

    • Element: The UI element to tap on.

Tap on (Element) and hold for (duration) milliseconds

Simulates a long press on the specified element for the given duration.
  • Usage: Ideal for actions that require a long press, such as context menus.

    Tap on mobile > search and hold for 5000 milliseconds
  • Arguments:

    • Element: The UI element to long press.
  • Duration: Duration in milliseconds to hold the tap.

Pinch IN on (Element)

Simulates a pinch-in gesture on the specified element.
  • Usage: Typically used for zooming out on images or maps.

    Pinch IN on mobile > search
  • Arguments:

    • Element: The UI element to perform the pinch-in gesture.

Pinch OUT on (Element)

Simulates a pinch-out gesture on the specified element.
  • Usage:
    Useful for zooming into images or maps.

    Pinch OUT on mobile > search
  • Arguments:

    • Element: The UI element to perform the pinch-out gesture.

Double tap on (Element)

Simulates a double-tap on the specified element.
  • Usage: Used for actions requiring a quick, repeated tap, such as liking a post

    Double tap on mobile > OK
  • Arguments:

    • Element: The UI element to double-tap.

Click on (Element)

Click on (Element)
  • Usage: Similar to "Tap," useful for click actions in web-based interfaces on mobile.

    Click on mobile > search
  • Arguments:

    • Element: The UI element to click.

Scroll vertically on (Element)

Simulates a vertical scroll on the specified element.
  • Usage: Ideal for navigating through vertically scrollable content.
    Scroll vertically on mobile > product

Scroll horizontally on (Element)

Simulates a horizontal scroll on the specified element.
  • Usage: Useful for horizontally scrollable elements like carousels.
    Scroll horizontally on mobile > carousel
  • Arguments:

    • The UI element to perform the horizontal scroll.

Swipe on (Element) for distance (x), (y) and hold for (duration) milliseconds

Simulates a swipe gesture on the specified element with defined distance and duration.
  • Usage: Used for swipe-based interactions, such as dismissing notifications or navigating between screens.

    Swipe on mobile > notification for distance 100, 0 and hold for 5000 milliseconds
  • Arguments:

    • Element: The UI element to swipe.
    • Distance (x, y): X and Y coordinates representing swipe distance.
    • Duration: Time in milliseconds to hold the swipe.

Input value (value) in (Element)

Simulates typing a specified value into the targeted element.
  • Usage: Use this action to fill input fields, such as forms, search boxes, or login credentials.

    Input value DevAssure in SearchField
  • Arguments:

    • value: The text or value to be entered.
    • Element: The UI element where the value should be input.

Wait for (Element) to be present

Waits until the specified element is present in the DOM.
  • Usage:

Use this action to ensure the presence of an element before performing further interactions.

Wait for LoginButton to be present
  • Arguments:
    • Element: The target UI element.

Wait for (Element) to be present within (duration) milliseconds

Waits for the specified element to be present in the DOM within a given time frame.
  • Usage:

Use this action when timing is critical and you need to limit wait times.

Wait for SubmitButton to be present within 5000 milliseconds
  • Arguments:
    • Element: The target UI element.
    • duration: The maximum wait time in milliseconds.

Wait for (Element) to be visible

Waits until the specified element becomes visible on the screen.
  • Usage:

Use this action when an element needs to be visible before interaction, such as buttons or forms.

Wait for WelcomeBanner to be visible
  • Arguments:
    • Element: The target UI element.

Wait for (Element) to be visible within (duration) milliseconds

Waits for the specified element to become visible within a given time frame.
  • Usage:

Use this action when you need precise control over wait times for visibility.

Wait for Popup to be visible within 3000 milliseconds
  • Arguments:
    • Element: The target UI element.

Wait for (Element) to disappear

Waits until the specified element is no longer visible on the screen.
  • Usage:

Use this action to ensure that an element has disappeared before proceeding, such as loading spinners.

Wait for LoadingSpinner to disappear
  • Arguments:
    • Element: The target UI element.

Wait for (Element) to disappear within (duration) milliseconds

Waits for the specified element to disappear from the screen within a given time frame.
  • Usage:

Use this action when you need to limit the wait time for an element's disappearance.

Wait for Tooltip to disappear within 2000 milliseconds
  • Arguments:
    • Element: The target UI element.
    • duration: The maximum wait time in milliseconds.

Is (Element) visible within (duration) milliseconds

Checks if the specified element becomes visible within a given time frame.
  • Usage:

Use this action to verify the visibility of an element within a limited time window.

Is Notification visible within 4000 milliseconds
  • Arguments:
    • Element: The target UI element.
    • duration: The maximum wait time in milliseconds.

Is (Element) present within (duration) milliseconds

Checks if the specified element exists on the web page within the given time duration.
  • Usage:

This action is useful for ensuring an element appears on the screen within a specified timeframe.

Is Submit Button present within 5000 milliseconds
  • Arguments:
    • Element: The target UI element.
    • duration: The maximum wait time in milliseconds.
  • Returns:
    • Boolean. True if the element is present within the duration, otherwise False.

Get text of Element

Use this action to extract and validate the text content of UI elements.
  • Usage:

Use this action to extract and validate the text content of UI elements.

text = Get text of "Welcome Message"
  • Arguments:
    • Element: The element whose text is to be fetched.
  • Returns:
    • A string containing the text of the element.

Get Count of Element

Counts the occurrences of the specified element on the web page.
  • Usage:

Useful for verifying dynamic lists or multiple instances of a UI component.

elementCount_15 = Get count of mobilefirst > item
  • Arguments:
    • Element: The element to count
  • Returns:
    • An integer representing the number of instances of the element.

Get (n)th instance of Element

Fetches the nth instance of a specified element.
  • Usage:

Use this action to interact with a specific instance of a repeated UI component.

element = Get nth instance of mobilefirst > item with index n 3
  • Arguments:
    • Element: The element to count
    • n: The instance number to fetch.

Verify if (Element) is visible

Checks whether the specified element is visible on the web page.
  • Usage:

Confirm the visibility of an element before performing UI interactions.

Verify if "Popup" is visible
  • Arguments:
    • Element: The element to check

Verify if count of (Element) is (n)

Verifies if the number of occurrences of the specified element matches the expected count.
  • Usage:

Validate that the UI displays the correct number of elements.

Verify if count of "Menu Item" is 5
  • Arguments:
    • Element: The element to count
    • n: The expected number of occurrences.

Verify if text of (Element) is equal to (text)

Checks if the text content of the specified element matches the expected text.
  • Usage:

Ensure the element displays the correct content.

Verify if text of "Header" is equal to "Welcome to DevAssure"
  • Arguments:
    • Element: The element to check
    • text: The expected text.

Take Screenshot (label)

Captures a screenshot of the current visual state of the application and saves it with a label.
  • Usage:

Use this action to capture visual states for debugging or visual validation.

Take Screenshot "Login Page"
  • Arguments:

    • label: A descriptive name for the screenshot.
  • Returns: A saved screenshot file with the specified label.

Switch to Web View

Switches the context of the mobile test to the Web View, enabling interaction with web-based content within a mobile application.
  • Usage:

Use this action when your mobile application includes embedded web content (e.g., web pages or hybrid app components) that needs to be tested.

Switch to Web View

Switch to Native App

Switches the context of the mobile test back to the Native App, enabling interaction with native mobile application elements.
  • Usage:

Use this action when you need to return to testing native components after interacting with a Web View.

Switch to Native App