|
| 1 | +--- |
| 2 | +id: kaneai-scroll-until-mobile |
| 3 | +title: Scroll Until Element for Mobile Authoring |
| 4 | +hide_title: false |
| 5 | +sidebar_label: Scroll Until Element |
| 6 | +description: Learn how to use Scroll Until Element feature in KaneAI to automate scrolling using natural language commands for mobile app testing |
| 7 | +keywords: |
| 8 | + - lambdatest automation |
| 9 | + - lambdatest kaneai |
| 10 | + - kaneai mobile app |
| 11 | + - scroll until element |
| 12 | + - natural language commands |
| 13 | + - mobile scrolling |
| 14 | +url: https://www.lambdatest.com/support/docs/kaneai-scroll-until-mobile/ |
| 15 | +site_name: LambdaTest |
| 16 | +slug: kaneai-scroll-until-mobile/ |
| 17 | +--- |
| 18 | + |
| 19 | +<script type="application/ld+json" |
| 20 | + dangerouslySetInnerHTML={{ __html: JSON.stringify({ |
| 21 | + "@context": "https://schema.org", |
| 22 | + "@type": "BreadcrumbList", |
| 23 | + "itemListElement": [{ |
| 24 | + "@type": "ListItem", |
| 25 | + "position": 1, |
| 26 | + "name": "LambdaTest", |
| 27 | + "item": "https://www.lambdatest.com" |
| 28 | + },{ |
| 29 | + "@type": "ListItem", |
| 30 | + "position": 2, |
| 31 | + "name": "Support", |
| 32 | + "item": "https://www.lambdatest.com/support/docs/" |
| 33 | + },{ |
| 34 | + "@type": "ListItem", |
| 35 | + "position": 3, |
| 36 | + "name": "Scroll Until Element", |
| 37 | + "item": "https://www.lambdatest.com/support/docs/kaneai-scroll-until-mobile/" |
| 38 | + }] |
| 39 | + }) |
| 40 | + }} |
| 41 | +></script> |
| 42 | + |
| 43 | +> This document provides a comprehensive guide on using the Scroll Until Element feature in KaneAI. It covers how to define scroll actions using simple natural language commands, eliminating the need for manual coordinate-based scripting for mobile app testing. |
| 44 | +
|
| 45 | +--- |
| 46 | + |
| 47 | +## Overview |
| 48 | + |
| 49 | +In modern mobile and web applications, important elements are often located below the fold or deep within long, scrollable pages. Writing custom scroll logic or managing scroll coordinates manually can be fragile, difficult to maintain, and time-consuming. |
| 50 | + |
| 51 | +The **Scroll Until Element** feature allows users to automate scrolling using **natural language commands**. Instead of controlling how to scroll, users simply describe the element they want to reach. |
| 52 | + |
| 53 | +This feature helps by: |
| 54 | +- **Automatically locating elements** by scrolling until the target becomes visible |
| 55 | +- **Reducing complexity** by removing the need for technical selectors or manual scroll logic |
| 56 | + |
| 57 | +--- |
| 58 | + |
| 59 | +## How-To Guide |
| 60 | + |
| 61 | +### Identify the Target |
| 62 | + |
| 63 | +Determine the element you need to reach based on its **visual representation**. |
| 64 | + |
| 65 | +In natural language mode, elements can be referenced using: |
| 66 | +- Visible text (e.g., *"Login button"*) |
| 67 | +- Element type (e.g., *"input field"*) |
| 68 | + |
| 69 | +> **Note:** |
| 70 | +> Natural language commands do **not** support technical selectors such as IDs, XPaths, or CSS attributes. |
| 71 | +> Always describe what is visibly present on the screen. |
| 72 | +
|
| 73 | +--- |
| 74 | + |
| 75 | +### Formulate the Command |
| 76 | + |
| 77 | +Enter your command into the test editor using **action-oriented language**. |
| 78 | +Clearly specify what the agent should find and what action to perform once found. |
| 79 | + |
| 80 | +**Examples:** |
| 81 | +- `"Scroll until search bar is visible and click on it."` |
| 82 | +- `"Scroll down until element with text 'Shipping Policy' is visible."` |
| 83 | +- `"Scroll inside a subsection until date input field and click on it."` |
| 84 | + |
| 85 | + |
| 86 | +--- |
| 87 | + |
| 88 | +## Use Cases |
| 89 | + |
| 90 | +| Scenario | Example Natural Language Command | |
| 91 | +|--------|--------------------------------| |
| 92 | +| Visibility Check | `Scroll until search bar is visible and click on it.` | |
| 93 | +| Text Search | `Scroll down until element with text XYZ is visible.` | |
| 94 | +| Button Interaction | `Scroll until Submit button and click on it.` | |
| 95 | +| Subsection Navigation | `Scroll inside a subsection until date input field and click on it.` | |
| 96 | +| Dropdown Selection | `Scroll inside the dropdown until 'New option' and select it.` | |
| 97 | + |
| 98 | +--- |
| 99 | + |
| 100 | +## Limitations |
| 101 | + |
| 102 | +Please be aware of the following constraints in the current version. |
| 103 | + |
| 104 | +--- |
| 105 | + |
| 106 | +### Mobile App Authoring |
| 107 | + |
| 108 | +- **Scroll Limit**: |
| 109 | + Maximum of **20 scroll attempts** are performed. If the element is not found, the action fails. |
| 110 | +- **Horizontal Scrolling**: |
| 111 | + ❌ Not supported (only vertical scrolling is available). |
| 112 | +- **Nested Containers**: |
| 113 | + ❌ Scrolling inside specific container elements is not supported; only the main viewport can be scrolled. |
| 114 | +- **Directional Extremes**: |
| 115 | + ❌ Commands such as *“Scroll to top”* or *“Scroll to bottom”* are not supported. |
| 116 | + |
| 117 | +--- |
| 118 | + |
| 119 | +### Mobile Browser Authoring |
| 120 | + |
| 121 | +- **Element Eligibility**: |
| 122 | + Applicable **only to interactable elements** (buttons, links, dropdowns, inputs). |
| 123 | + ❌ Plain text or static labels are not supported. |
| 124 | +- **Native Popups**: |
| 125 | + ❌ Scrolling inside native browser popups or system alerts is not supported. |
| 126 | +- **Horizontal Scrolling**: |
| 127 | + ❌ Not supported. |
| 128 | + |
| 129 | +--- |
| 130 | + |
| 131 | +## Troubleshooting |
| 132 | + |
| 133 | +If you encounter execution issues, refer to the table below: |
| 134 | + |
| 135 | +| Error Message / Behavior | Potential Cause | Solution | |
| 136 | +|------------------------|-----------------|----------| |
| 137 | +| Maximum Scroll Limit Reached | Element is beyond 20 scrolls or not present | Verify element visibility and ensure it appears within 20 scrolls | |
| 138 | +| Element Not Found | Non-interactable or plain text element (Mobile Browser) | Target a button, link, or input field instead | |
| 139 | +| Scroll Timeout | Element is inside a nested container (App Agent) | Use manual scroll steps if element is not in the main viewport | |
| 140 | +| Command Not Recognized | Usage of IDs, XPaths, or attributes | Rewrite using visible text or element type (e.g., "button") | |
| 141 | + |
| 142 | +--- |
| 143 | + |
| 144 | +> Have any feedback or request? Reach out to us via [[email protected]](mailto:[email protected]) and we would be happy to hear from you. |
0 commit comments