可能这个问题已经被问过很多次了。但是我在 stackoverflow 中解决了所有相关问题,但找不到任何令人满意的解决方案。
好吧,我正在使用 C# 在 VS2010 中编写 selenium 自动化代码,IE11 是我正在执行测试的 Web 浏览器。在 Windows 7 中使用 IEDriverServer 32 位版本打开 IE 实例。
我已经知道 selenium 和 IE 11 之间存在某种兼容性问题,但是直到现在我的代码仍然运行良好,当我开始收到此错误时 - “NoSuchWindowException 未处理:无法在关闭的窗口上找到元素。”
以下是我的步骤:-
IWebDriver driver = new InternetExplorerDriver("D:\\");
driver.Navigate().GoToUrl("http://aiaw00572.belldev.dev.bce.ca:8060/UTM_MechHDTool_UserWebApp");
driver.FindElement(By.Id("ctl00_cpMainContent_radcboTaskType_Input"), 10).Click();
driver.FindElement(By.XPath("//div[@id='ctl00_cpMainContent_radcboTaskType_DropDown']/div/ul/li[2]")).Click(); (this step select a drop down option which performs a postback on the page)
driver.FindElement(By.Id("ctl00_cpMainContent_utmTaskGrid_ctl00_ctl06_imgbtnStartWorking")).Click();//Getting error on this step. Earlier i was not getting it anywhere
我搜索了此问题的解决方案,并了解到一种解决方案,其中必须进行一些注册表更改才能解决该问题,尽管这也不能确认它会解决问题。但是这里的问题我什至无法检查此解决方案,因为我的系统中没有任何管理员权限。
所以只是想知道是否其他人也遇到了这个问题并提出了一些解决方案,所以他/她可以在这里分享它,因为我在这里非常需要针对这种情况的解决方案。
最佳答案
在以管理员身份运行 IEDriverServer 或为所有区域设置保护模式后为我工作( https://stackoverflow.com/a/21373224/217408 )
关于c# - NoSuchWindowException 未处理 : Unable to find element on closed window. IE 11 - Selenium C#,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/26712417/