title: org.openqa.selenium.interactions.MoveTargetOutOfBoundsException: (x, y) is out of bounds while MouseHover with GeckoDriver Firefox Selenium
body: <p>I am learning how to automate tests with Selenium WebDriver, however I got stuck and cannot make dropdown menu to work in Firefox. The same code runs perfectly fine in Chrome.</p>
  
  <p>The site I am practicing on is:
  <a href="http://www.executeautomation.com/demosite/index.html" rel="noreferrer">http://www.executeautomation.com/demosite/index.html</a>
  and I want to click the following item from menu: Automation Tools > Selenium > Selenium WebDriver.</p>
  
  <p>The error message suggest that the web element may not be loaded on the screen yet, so I have implemented some method to wait with every execution until the element shows up:</p>
  
  <pre><code>public static void ImplicitWait(WebDriver driver){
      driver.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);
  }
  </code></pre>
  
  <p>but it did not helped.</p>
  
  <p>Then I read that it is better to "pipe" those moveToElement() methods instead of performing them one by one. So I changed this:</p>
  
  <pre><code>action.moveToElement(menu).perform();
  action.moveToElement(selenium).perform();
  action.moveToElement(seleniumWebDriver).click().build().perform();
  </code></pre>
  
  <p>to one line. At this point it started to work on Chrome, but I am still struggling to make it work on Firefox.</p>
  
  <p>The current code looks like this:</p>
  
  <pre><code>System.setProperty("webdriver.gecko.driver", "C:\\Drivers\\geckodriver-v0.24.0-win64\\geckodriver.exe");
  System.setProperty("webdriver.firefox.bin", "C:\\Program Files\\Mozilla Firefox\\firefox.exe");
  WebDriver driver = new FirefoxDriver();
  
  ImplicitWait(driver);
  
  driver.navigate().to("http://executeautomation.com/demosite/index.html");
  
  WebElement menu = driver.findElement(By.id("Automation Tools"));
  WebElement selenium = driver.findElement(By.id("Selenium"));
  WebElement seleniumWebDriver = driver.findElement(By.id("Selenium WebDriver"));
  
  Actions action = new Actions(driver);
  action.moveToElement(menu).moveToElement(selenium).moveToElement(seleniumWebDriver).click().build().perform();
  </code></pre>
  
  <p>As I mentioned above the same works fine when I switch to Chrome, but with Firefox I get the error message:</p>
  
  <pre><code>Exception in thread "main" org.openqa.selenium.interactions.MoveTargetOutOfBoundsException: (-9862, 206) is out of bounds of viewport width (1283) and height (699)
  </code></pre>
  
  <p>I am using: 
  * Firefox v66.0.2
  * Java v1.8.0_201
  * Selenium Java v3.141.59
  * GeckoDriver v0.24.0</p>
  
  <p>Please help.</p>