title: Scrolling to a element in bootstrap modal in web driver is not working
body: <p>I am trying to close a bootstrap modal through Web driver script.The modal has Close button at the bottom.I am trying to scroll to the element and then click on the element but it is not working.when used <code>moveToELement(toElement)</code> method the script is throwing </p>
  
  <blockquote>
    <p>MoveTargetOutOfBoundsException: Offset within element cannot be
    scrolled into view:" exception</p>
  </blockquote>
  
  <p>. So I have tried to javascript scroll method and another way.They didn't throw any exception but it also didn't work. Below is the code</p>
  
  <pre><code>        WebDriver d=new FirefoxDriver();
          d.get("http://getbootstrap.com/javascript/");
          d.findElement(By.linkText("Modal")).click();
          d.findElement(By.cssSelector("button[data-target='#myModal']")).click();
          WebElement e=d.findElement(By.className("btn-default"));    
  //using moveToElement
          Actions a=new Actions(d);
          a.moveToElement(e).click().build().perform();
  //using js scroll
          JavascriptExecutor js=(JavascriptExecutor)d;
          Point p=e.getLocation();
          int y=p.getY();
          int x=p.getX();
          js.executeScript("scroll("+x+","+y+")");
          e,click();
  //another way 
          Coordinates coordinate = ((Locatable)e).getCoordinates(); 
          coordinate.onPage(); 
          coordinate.inViewPort();
          e.click();
  </code></pre>
  
  <p>Any suggestions regarding how to solve this.Thanks in advance</p>