If some buttons are visible or not, my program is doing different actions. In order to see those buttons i need to scroll to them.
I use this code:
JavascriptExecutor je=(JavascriptExecutor) driver;
WebElement elem=driver.findElement(By.xpath("//a[contains(.,'"+username+"')]/ancestor::div[contains(@class, 'js-answer-element')]"));
je.executeScript("arguments[0].scrollIntoView(true)", elem);
How can scroll until all the square is into view?

