Instantly share code, notes, and snippets.

Embed
What would you like to do?
generated automatically from #selenium on seleniumhq slack
public void scrollIntoView(Element element) {
final Actions actions = new Actions(this);
actions.moveToElement(element).perform();
if (element.getLocation().y <= 50) {
actions.moveToElement(element, 0, -50).perform();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment