title: How to keyPress Page Down multiple times in selenium WebDriver using java?
body: <p>I want to scroll down using Robot class in Selenium WebDriver using Java. I have figured out that in order to access the required element in the webpage I have to press <code>PgDn</code> button 28 times. Hence, I want to press <code>PgDn</code> button 28 times using Robot class. The code I wrote to do this is given below:</p>
  
  <pre><code>try {
      Robot robot = new Robot();
  
      for(int i=0; i&lt;29; i++) {
          robot.keyPress(KeyEvent.VK_PAGE_DOWN);
      }
  
  } catch (AWTException e1) {
     // TODO Auto-generated catch block
     e1.printStackTrace();
  }
  </code></pre>
  
  <p>I used a for loop to do this but it is not working. The <code>PgDn</code> KeyEvent is getting executed only once.</p>