Skip to content

Instantly share code, notes, and snippets.

@angelovstanton
Created July 2, 2017 18:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save angelovstanton/ea787c7afec0506da2d7aa12e62b4458 to your computer and use it in GitHub Desktop.
Save angelovstanton/ea787c7afec0506da2d7aa12e62b4458 to your computer and use it in GitHub Desktop.
[Test]
public void TestWithFirefoxDriver()
{
using (var driver = new FirefoxDriver())
{
driver.Navigate().GoToUrl(@"https://automatetheplanet.com/multiple-files-page-objects-item-templates/");
var link = driver.FindElement(By.PartialLinkText("TFS Test API"));
var jsToBeExecuted = $"window.scroll(0, {link.Location.Y});";
((IJavaScriptExecutor)driver).ExecuteScript(jsToBeExecuted);
var wait = new WebDriverWait(driver, TimeSpan.FromMinutes(1));
var clickableElement = wait.Until(ExpectedConditions.ElementToBeClickable(By.PartialLinkText("TFS Test API")));
clickableElement.Click();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment