How do I scroll down in Selenium?

How do I scroll down in Selenium?

The JavaScriptExecutor provides an interface that enables QAs to run JavaScript methods from Selenium scripts. Hence, Selenium scroll up or Selenium scroll down, a JavaScriptExecutor is a must. The scrollBy() method involves two parameters, x, and y, that represent the horizontal and vertical pixel values, respectively.