【发布时间】:2015-04-14 08:25:34
【问题描述】:
我在使用 Teamcity 的构建服务器上使用用 C# .NET 和在 Internet Explorer 8 中运行的 NUnit 框架编写的 Selenium WebDriver 自动化测试。
第一个问题是它启动 IEDriverServer,然后启动 Internet Explorer 浏览器进程,但我看不到它们 - 它们以某种方式隐藏。在任务管理器中,我可以在“进程”选项卡中看到它们,但不能在“应用程序”选项卡中看到它们。但是,当我在本地主机上运行相同的代码时,它通常是可见的,我可以看到测试中发生了什么。
第二个问题,可能与第一个问题有关,是它在完成测试后没有关闭 iexplore 进程,因此它们停留在那里,一段时间后它被卡住并且测试失败错误信息:
SetUp method failed. SetUp : System.InvalidOperationException : Unexpected error launching Internet Explorer. IELaunchURL() returned HRESULT 80070490 ('Element not found.') for URL 'http://localhost:64352/' (NoSuchDriver)
at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities)
我找到的唯一解决方案是在完成测试后终止所有 iexplore 进程,但这种行为一定有一些原因。而且我还希望在执行自动化测试时看到 Internet Explorer 运行。
有人也遇到过这个问题吗?
【问题讨论】:
标签: c# selenium internet-explorer-8 webdriver teamcity