Created
August 20, 2020 10:33
-
-
Save angelovstanton/056f0723267532dffd06a16fa3294c90 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Test | |
public void scrollFocusToControl() { | |
driver.navigate().to("http://automatetheplanet.com/"); | |
var ourMissionLink = driver.findElement(By.xpath("//*[@id=\"panel-6435-0-0-4\"]/div")); | |
String jsToBeExecuted = String.format("window.scroll(0, {0});", ourMissionLink.getLocation().getY()); | |
JavascriptExecutor javascriptExecutor = (JavascriptExecutor) driver; | |
javascriptExecutor.executeScript(jsToBeExecuted); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment