title: What is the difference between the different scroll options?
body: <p>I have tried a few ways of adding scrolling to tables, but just one of them works correctly. What is the different between them?</p>
  
  <h3>First:</h3>
  
  <pre><code>JavascriptExecutor js = (JavascriptExecutor) driver;
  js.executeScript("arguments[0].scrollIntoView();", Element);
  </code></pre>
  
  <h3>Second:</h3>
  
  <pre><code>WebElement element1 = driver.findElement(By.id("scrolled_element"));
  ((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView(true);", element1);
  </code></pre>
  
  <h3>Third:</h3>
  
  <pre><code>JavascriptExecutor js = (JavascriptExecutor) driver;
  js.executeScript("window.scrollBy(0,1000)");
  </code></pre>
  
  <h3>Fourth:</h3>
  
  <pre><code>JavascriptExecutor js = (JavascriptExecutor) driver;
  js.executeScript("window.scrollTo(0, document.body.scrollHeight)");
  </code></pre>