> For the complete documentation index, see [llms.txt](https://docs.bugbug.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bugbug.io/~/changes/458/preventing-failed-tests/smart-scroll.md).

# Smart scroll

Discover how to prevent failed tests with smart scroll. Improve your test efficiency and reliability using BugBug's smart scroll feature. Learn more now!

BugBug simulates [real user clicks and mouse movements](/~/changes/458/preventing-failed-tests/smart-click.md), so the element needs to be visible in the viewport to actually click it.

BugBug will try to behave like a human: we will automatically attempt to scroll the page to see the element and interact with it.

**So you don't need to maintain the scroll actions!** :tada:

Your tests <mark style="color:green;">**will not fail**</mark> if:

* some content on the page changed and pushed the clickable element down outside of the browser viewport
* some fixed popup or an ad covered the element completely, but it is still reachable if you scroll more

{% hint style="info" %}
You can still [manually add scroll steps](/~/changes/458/editing-tests/manually-creating-the-test.md), for handling more complex scrolling and items with their own overflow scroll.&#x20;
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.bugbug.io/~/changes/458/preventing-failed-tests/smart-scroll.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
