title: How to Scroll down with Selenium?
body: <p>In <a href="https://signup.insly.com/signup" rel="nofollow noreferrer">this</a> page, I need to click on the link <strong><em>Privacy Policy</em></strong> ,(it opens a new dialog),and I must scroll <strong>down</strong>, using Selenium, and Java.</p>
  
  <p>Here is what i have tried:</p>
  
  <pre><code>WebElement element = driver.findElement(By.xpath("/html/body/div[2]"));
  ((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView(true);", element);
  </code></pre>
  
  <p>it does not work. <strong>It scrolls the background page instead of the active dialog.</strong></p>