In Selenium WebDriver, there are two major methods to put an element into a visible area:
((JavascriptExecutor) driver).executeScript(arguments[0].scrollIntoView(true);, element);
Using
moveToElement
browser action:
Actions actions = new Actions(driver);
actions.moveToElement(element);
actions.perform();
Are these methods equivalent and which one should be preferred?