public void JsLocatedElementsCanUpdateFramesIfFoundSomehowElse()
{
driver.SwitchTo().Frame("source");
// Prime the cache of elements
driver.FindElement(By.Id("otherframe"));
// This _should_ return the same element
IWebElement toClick = (IWebElement)((IJavaScriptExecutor)driver).ExecuteScript("return document.getElementById('otherframe');");
toClick.Click();
driver.SwitchTo().DefaultContent().SwitchTo().Frame("target");
Assert.IsTrue(driver.PageSource.Contains("Hello WebDriver"), "Target did not reload");
}