Mobile tests can only find and interact with elements in the current page view. To interact with elements outside the current page view, add scroll steps.
Swiping gestures can be achieved using the scrolling step.
When you scroll in the app, the Trainer automatically captures the direction of the scroll and the percentage of the screen scrolled. Depending on your goal, you can also add steps to scroll to an element and scroll within an element.
Scroll to element
If a target element isn’t visible in the initial viewport, take the following steps:
- Pause recording.
- Manually scroll until the target element is visible on the screen.
- Resume recording.
- Click the plus sign to add a new step.
- Select Scroll to element.
- In the overlay that appears, select the target element.
- Click OK to save the step.
The “scroll to element” step includes options for configuring the scrolling direction, the maximum number of scroll attempts, and selecting an element to scroll within. If mabl doesn’t find the element within the scroll attempt threshold, the step will fail. If the target element’s text or attributes vary between runs, use Configure Find on the saved step to match by partial text or a subset of attributes.
Scrolling to an element
Scrolling within an element
When interacting with smaller scrollable elements, such as pickers, take the following steps to scroll within an element:
- Pause recording.
- Manually scroll until the scrollable element is visible on the screen.
- Resume recording.
- Click the plus sign to add a new step.
- Select Scroll to element.
- In the Scroll behavior menu, make sure the Type is set to “Scroll within element.”
- In the overlay, select the target element.
- Click OK to save the step.
If needed, you can edit the scroll direction and scroll coordinates after the step is created.