【发布时间】:2015-12-23 16:52:17
【问题描述】:
关于我之前的question,在 Iframe 模式关闭后,我无法返回初始页面。
我尝试使用
driver.SwitchTo().DefaultContent();
string currentWindow = driver.CurrentWindowHandle; //called before iframe modal popup window is called to open.
driver.SwitchTo().Window(currentWindow);
但未能这样做并收到错误:----> OpenQA.Selenium.StaleElementReferenceException : 在缓存中找不到元素 - 页面可能在查找后已更改。
预期结果:按钮应该被点击
实际结果:收到错误消息。
【问题讨论】:
标签: c# selenium iframe automation