# Scroll in dropdown triggers scroll on the main page

**URL:** <https://forum.katalon.com/t/scroll-in-dropdown-triggers-scroll-on-the-main-page/57734>\
**Category:** Miscellaneous\
**Tags:** start-page\
**Created:** [August 25, 2021, 4:32pm UTC](https://forum.katalon.com/t/scroll-in-dropdown-triggers-scroll-on-the-main-page/57734 "2021-08-25T16:32:10Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![irina.eris](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/irina.eris/32/16104_2.png) [@irina.eris](https://forum.katalon.com/u/irina.eris)\
**Post date:** [August 25, 2021, 4:32pm UTC](https://forum.katalon.com/t/scroll-in-dropdown-triggers-scroll-on-the-main-page/57734/1 "2021-08-25T16:32:11Z")

</div>

Hi everyone,

I am encountering an issue during testing.  
I cannot manage to scroll down in a dropdown.

The flow is the following:

- click a field
- a dropdown is shown on the page
- now, in order for me to select the value that I need I must scroll in the dropdown.

I have tried the scroll to element method but it would scroll the main page instead of the dropdown.  
The code\_x locator is a variable that goes in a test data file to pick the values that I want to select in the dropdown.

Thanks for you help.

 ![HTML_code](https://europe1.discourse-cdn.com/katalon/original/3X/3/e/3eef76244e6f23039379078a57666f69c6dcbe93.png)  
 ![katalon_code](https://europe1.discourse-cdn.com/katalon/original/3X/a/3/a3b1f379370b5cee20521d4873f17a357aa9f588.png)

 ![locator_codeX](https://europe1.discourse-cdn.com/katalon/original/3X/5/d/5d73783c062308be98e54444f5cd1207cda7ff4f.png)

---

<div class="post-metadata">

**Author:** ![grylion54](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/grylion54/32/16265_2.png) [@grylion54](https://forum.katalon.com/u/grylion54)\
**Post date:** [August 25, 2021, 8:47pm UTC](https://forum.katalon.com/t/scroll-in-dropdown-triggers-scroll-on-the-main-page/57734/2 "2021-08-25T20:47:21Z")

</div>

If you **right** click on one of the drop-down contents (like on “FM02b\_10”) and select **Inspect** , does the HTML look like a column of similar element types? In other words, can you collect a list of web elements (`List<WebElement>` ) and then move through the list of elements like they were a “table” and choose one this way. It may mean to “loop” through the “table” comparing the items to your “pick”.

---

<div class="post-metadata">

**Author:** ![irina.eris](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/irina.eris/32/16104_2.png) [@irina.eris](https://forum.katalon.com/u/irina.eris)\
**Post date:** [August 26, 2021, 11:49am UTC](https://forum.katalon.com/t/scroll-in-dropdown-triggers-scroll-on-the-main-page/57734/3 "2021-08-26T11:49:44Z")

</div>

Hi,

Does anyone have a different approach for handling the issue?

Thanks 🙂

---

<div class="post-metadata">

**Author:** ![Russ\_Thomas](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/russ_thomas/32/11884_2.png) [@Russ\_Thomas](https://forum.katalon.com/u/Russ_Thomas)\
**Post date:** [August 26, 2021, 12:32pm UTC](https://forum.katalon.com/t/scroll-in-dropdown-triggers-scroll-on-the-main-page/57734/4 "2021-08-26T12:32:58Z")

</div>

In essence, @grylion54 has given you a pretty clear method to approach this problem. Instead of just ignoring what’s been said, can you explain why it didn’t work for you?

My approach would be something like…

1. Using JavaScript…
2. Make the dropdown appear
3. Call the Web API `scrollIntoView()` on the element I need to see
4. Click the element.

> **[Element.scrollIntoView() - Web APIs | MDN](https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView)**
>
> The Element interface's
> scrollIntoView() method scrolls the element's parent
> container such that the element on which scrollIntoView() is called is
> visible to the user.

---

<div class="post-metadata">

**Author:** ![irina.eris](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/irina.eris/32/16104_2.png) [@irina.eris](https://forum.katalon.com/u/irina.eris)\
**Post date:** [August 26, 2021, 12:48pm UTC](https://forum.katalon.com/t/scroll-in-dropdown-triggers-scroll-on-the-main-page/57734/5 "2021-08-26T12:48:26Z")

</div>

Hi Russ,

I did not ignore the answer, I am working on it.  
I was just curious for other approaches.

I highly appreciate the answer.  
Irina

---

<div class="post-metadata">

**Author:** ![irina.eris](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/irina.eris/32/16104_2.png) [@irina.eris](https://forum.katalon.com/u/irina.eris)\
**Post date:** [August 27, 2021, 8:34am UTC](https://forum.katalon.com/t/scroll-in-dropdown-triggers-scroll-on-the-main-page/57734/6 "2021-08-27T08:34:50Z")

</div>

Hi Russ,

I am working on the approach you described me above, however I still do not see the scroll in the dropdown functioning.  
I guess I am still missing something related to the scriollIntoView function.

 ![katalon_java_script](https://europe1.discourse-cdn.com/katalon/original/3X/3/8/383eb58fe3236627df8bf8c447fe86b9dcd352f9.png)

---

<div class="post-metadata">

**Author:** ![irina.eris](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/irina.eris/32/16104_2.png) [@irina.eris](https://forum.katalon.com/u/irina.eris)\
**Post date:** [August 27, 2021, 11:17am UTC](https://forum.katalon.com/t/scroll-in-dropdown-triggers-scroll-on-the-main-page/57734/7 "2021-08-27T11:17:37Z")

</div>

Found the solution,

I had to change the value of the scrollIntoView function to “false”.

Thanks

---

<div class="post-metadata">

**Author:** ![Russ\_Thomas](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/russ_thomas/32/11884_2.png) [@Russ\_Thomas](https://forum.katalon.com/u/Russ_Thomas)\
**Post date:** [August 27, 2021, 12:59pm UTC](https://forum.katalon.com/t/scroll-in-dropdown-triggers-scroll-on-the-main-page/57734/8 "2021-08-27T12:59:41Z")

</div>

Interesting. I’ve only ever used the default, `true`.

 ![image](https://europe1.discourse-cdn.com/katalon/original/3X/e/2/e2001a571890b00df127cc62282be0144ac71c67.png)

Good you got it working 🙂
