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 MovingBetweenTabs() | |
{ | |
this.driver.Navigate().GoToUrl(@"http://automatetheplanet.com/compelling-sunday-14022016/"); | |
driver.FindElement(By.LinkText("10 Advanced WebDriver Tips and Tricks Part 1")).Click(); | |
driver.FindElement(By.LinkText("The Ultimate Guide To Unit Testing in ASP.NET MVC")).Click(); | |
ReadOnlyCollection<String> windowHandles = driver.WindowHandles; | |
String firstTab = windowHandles.First(); | |
String lastTab = windowHandles.Last(); | |
driver.SwitchTo().Window(lastTab); | |
Assert.AreEqual<string>("The Ultimate Guide To Unit Testing in ASP.NET MVC", driver.Title); | |
driver.SwitchTo().Window(firstTab); | |
Assert.AreEqual<string>("Compelling Sunday – 19 Posts on Programming and Quality Assurance", driver.Title); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment