# Smart scroll

BugBug simulates [real user clicks and mouse movements](/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](/editing-tests/manually-creating-the-test.md), for handling more complex scrolling and items with their own overflow scroll.&#x20;
{% endhint %}


---

# 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.bugbug.io/preventing-failed-tests/smart-scroll.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.
