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.
Scroll (parentElement) until (element) is in viewScrolls within the specified parent element until the target element is visible
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.
Send Keys (text, element)Sends a specified text input to the targeted UI element.
Clear Text (element)Clears any existing text from the targeted UI 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.
Is (Element) checked within (duration) millisecondsChecks whether the specified UI element is in a checked state.
Is (Element) enabled within (duration) millisecondsChecks whether the specified UI element is enabled and interactive.

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.

Device

ActionDescription
Unlock DeviceUnlocks the mobile device.
Lock DeviceLocks the mobile device.
Hide KeyboardHides the on-screen keyboard if it is currently visible.
Open AppLaunches the specified app on the mobile device
Close AppCloses the specified app on the mobile device
Minimise App for (duration) secondsMinimises the app for a specified duration.

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.

Scroll (parentElement) until (element) is in view

Scrolls within the specified parent element until the target element is visible.
  • Usage: Use this action to ensure off-screen elements are scrolled into view for interaction.
    Scroll mobile > Main > startPageElement0 until mobile > Login is in view
  • Arguments:

    • parentElement: The container element where scrolling will occur.

    • element: The target UI element to bring into view.

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.

Send Keys (text, element)

Sends a specified text input to the targeted UI element.
  • Usage:

Use this action to input text into fields like search bars or login forms.

Send keys [email protected] to mobile > login

Clear Text (element)

Clears any existing text from the targeted UI element.
  • Usage:

Use this action to reset input fields before entering new data.

Clear Text in SearchField
  • Arguments:
    • Element: The UI element whose text should be cleared.

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.

Is (Element) enabled within (duration) milliseconds

Checks whether the specified UI element is enabled and interactive.
  • Usage:

Use this action to verify if an element is available for interaction.

isEnabled = Is element mobile > submit enabled within 5000 milliseconds
  • Arguments:
    • Element: The target UI element to be checked.
    • duration: The maximum wait time in milliseconds.
  • Returns:
    • Boolean. True if the element is enabled within the duration, otherwise False.

Is (Element) Checked within (duration) milliseconds

Checks whether the specified UI element is in a checked state (e.g., checkbox or radio button).
  • Usage:

Use this action to verify the state of selectable elements.

isChecked = Is element mobile > terms  checked within 5000 milliseconds
  • Arguments:
    • Element: The target UI element.
    • duration: The maximum wait time in milliseconds.
  • Returns:
    • Boolean. True if the element is checked 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

Unlock Device

Unlocks the mobile device.
  • Usage:

Use this action to unlock the device before performing further actions.

Unlock device

Lock Device

Locks the mobile device.
  • Usage:

Use this action to lock the device to maintain security after testing.

Lock device

Hide Keyboard

Hides the on-screen keyboard if it is currently visible.
  • Usage:

Use this action to ensure the keyboard does not obstruct other UI elements.

Hide keyboard

Open App

Launches the specified app on the mobile device.
  • Usage:

Use this action to start the app you want to test.

Open app

Close App

Closes the specified app on the mobile device.
  • Usage:

Use this action to terminate the app after testing.

Close app

Minimise App for (duration) seconds

Minimises the app for a specified duration.
  • Usage:

Use this action to simulate backgrounding the app for a specific time.

Minimise app for 5000 seconds