# Scroll Until “X” Command

The Scroll Until “X” command scrolls in the specified direction until a target element appears. All targets must be enclosed in double quotes to ensure stable and precise detection. The scroll intent must be explicit: what direction to scroll, what target to look for, and where the target belongs.

## 1. Scroll Until Element Appears

**When to use:**

1. Navigating long vertical pages
2. Jumping to a CTA button below the fold
3. Returning to the top of a page
4. Accessing sections hidden by screen height

**Example:**

1. Scroll down until "Proceed to Pay"
2. Scroll up until "Home" tag is visible&#x20;
3. Scroll right until "Next" CTA is visible&#x20;

## 2. Scroll Until With Clear Intent (Recommended)

**When to use:**

1. Locating a specific labelled section
2. Reaching UI elements that trigger next actions
3. Ensuring stable scroll movement when the label is unique
4. Stronger stability versus blind scrolling<br>

**Example:**

1. Scroll down until "Apply Coupon"
2. Scroll up until "Back to Top"
3. Scroll right until "More Categories"

## 3. Scroll Until With Section / Header Context

**When to use:**

1. Product grids grouped by category
2. Lists segmented by headers
3. Sections that contain repeated patterns (cards, tiles, rows)
4. When multiple identical product tiles exist
5. Ensures Drizz searches only within the correct context

**Example:**&#x20;

1. Scroll down until you find 4 product cards under "Beauty"
2. Scroll down until items appear under "Snacks"
3. Scroll up until offers are visible under "Top Deals"

## 4. Scroll Until Inside a Container

**When to use:**

* Screens with nested scrollable regions
* App layouts where reviews, details, or related items scroll separately
* To avoid unintended scrolling of the entire page
* Ensures precision when scrolling must be restricted to a specific block

**Example:**

1. Scroll down inside product list until "Add to Cart"
2. Scroll right inside categories until "Electronics"
3. Scroll down inside reviews until "Write a Review"

##


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.drizz.dev/commands-reference/action-commands/scroll-command/scroll-until-x-command.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
