'Jmeter/Selenium scroll down in a specific area and not the entire page

I am having trouble trying to figure out how to scroll down a one section only from the entire webpage. I have tried window.scrollBy(x,y) which works but for the entire page and not the section which I need. The scroll bar does not show up either. I am using JMeter (JS as language) and Selenium as the driver.

enter image description here



Solution 1:[1]

Try the following:

  • var element = WDS.browser.findElement(org.openqa.selenium.By.id('some id')) - locate the Web Element you want to "see"
  • WDS.browser.executeScript('arguments[0].scrollIntoView(true);', element) - bring the element into the visible area

More information:

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Dmitri T