Created
February 20, 2016 11:12
-
-
Save angelovstanton/af9d727d8e18672bb6dd 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
[TestMethod] | |
public void ScrollFocusToControl() | |
{ | |
this.driver.Navigate().GoToUrl(@"http://automatetheplanet.com/compelling-sunday-14022016/"); | |
IWebElement link = driver.FindElement(By.PartialLinkText("Previous post")); | |
string jsToBeExecuted = string.Format("window.scroll(0, {0});", link.Location.Y); | |
((IJavaScriptExecutor)driver).ExecuteScript(jsToBeExecuted); | |
link.Click(); | |
Assert.AreEqual<string>("10 Advanced WebDriver Tips and Tricks - Part 1", driver.Title); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment