Having trouble with the FireFox/IE9 driver in Selenium? When using the Actions class and its moveToElement method, I keep encountering a MoveTargetOutOfBoundsException error. Despite trying different solutions like Coordinates, Point, and javascriptexecutor, nothing seems to work. Oddly enough, the moveToElement method works perfectly fine with my Chrome driver. Why is it that Firefox33/IE9 are causing issues when they are native to Selenium?
Take a look at this code snippet:
WebElement requiredCheckbox = new WebDriverWait(driver,15).until(ExpectedConditions.presenceOfElementLocated(By.name("tc_n_cs_subscribe_1")));
// Point points = requiredCheckbox.getLocation();
// System.out.println(points.getX());
// System.out.println(points.getY());
// actions.moveByOffset(points.getX(), points.getY()).perform();
// ((JavascriptExecutor)
// driver).executeScript("window.scrollBy(0, "+points.getY()+");");
// ((JavascriptExecutor) driver).executeScript(
// "arguments[0].scrollIntoView();", requiredCheckbox);
// Coordinates coordinate =
// ((Locatable)requiredCheckbox).getCoordinates();
// coordinate.onPage();
// coordinate.inViewPort();
actions.moveToElement(requiredCheckbox).build().perform();
requiredCheckbox.click();