Selenium C# example not working


In, in the “New Window” section, the window pops up and is tested before rendering is complete.

You may want to consider adding a wait to the code like this:

string newWindowHandle = _driver.WindowHandles.Last();

var newWindow = _driver.SwitchTo().Window(newWindowHandle);

WebDriverWait wait = new WebDriverWait(_driver, TimeSpan.FromSeconds(30));

wait.Until(d => d.Title != string.Empty);
string expectedNewWindowTitle = "QA Automation Tools Tutorial";


Add Comment
  • 0 Answer(s)
  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.