public void ShouldThrowNoSuchWindowException()
{
driver.Url = xhtmlTestPage;
String current = driver.GetWindowHandle();
try
{
driver.SwitchTo().Window("invalid name");
}
catch (NoSuchWindowException)
{
// This is expected.
}
driver.SwitchTo().Window(current);
}