所以今天早上我开始工作,发现IE上的所有测试都失败了。我在当地运行它们并观察发生了什么。测试未能完成OneTimeSetUp功能。我可以看到浏览器打开,测试将转到第一页,但随后它会旋转,直到我最终得到此异常
------ Run test started ------
NUnit Adapter 3.0.8.0 executing tests is started
Running selected tests in C:\git\POMAuctivaTest\POMAuctivaTest.TestSuite\bin\Debug\POMAuctivaTest.TestSuite.dll
Loading tests from C:\git\POMAuctivaTest\POMAuctivaTest.TestSuite\bin\Debug\POMAuctivaTest.TestSuite.dll
SetUp failed for test fixture POMAuctivaTest.TestSuite.ExistingUserTestSuite<InternetExplorerDriver>
OpenQA.Selenium.WebDriverException : The HTTP request to the remote WebDriver server for URL http://localhost:63157/session/343ab5e2-89a4-4f27-bf45-bb12ff91a347/element timed out after 60 seconds.
----> System.Net.WebException : The operation has timed out
at OpenQA.Selenium.Remote.HttpCommandExecutor.CreateResponse(WebRequest request)
at OpenQA.Selenium.Remote.HttpCommandExecutor.Execute(Command commandToExecute)
at OpenQA.Selenium.Remote.DriverServiceCommandExecutor.Execute(Command commandToExecute)
at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
at OpenQA.Selenium.Remote.RemoteWebDriver.FindElement(String mechanism, String value)
at OpenQA.Selenium.Remote.RemoteWebDriver.FindElementById(String id)
at OpenQA.Selenium.By.<>c__DisplayClass2.<Id>b__0(ISearchContext context)
at OpenQA.Selenium.By.FindElement(ISearchContext context)
at OpenQA.Selenium.Remote.RemoteWebDriver.FindElement(By by)
at OpenQA.Selenium.Support.UI.ExpectedConditions.<>c__DisplayClass13. <ElementIsVisible>b__12(IWebDriver driver)
at OpenQA.Selenium.Support.UI.DefaultWait`1.Until[TResult](Func`2 condition)
at POMAuctivaTest.AuctivaPageModels.BasePageModel.WaitForElementVisible(IWebDriver driver, By element) in c:\git\POMAuctivaTest\POMAuctivaTest.AuctivaPageModels\BasePageModel.cs:line 143
at POMAuctivaTest.TestSuite.ExistingUserTestSuite`1.SetUp() in c:\git\POMAuctivaTest\POMAuctivaTest.TestSuite\ExistingUserTestSuite.cs:line 43
--WebException
at System.Net.HttpWebRequest.GetResponse()
at OpenQA.Selenium.Remote.HttpCommandExecutor.CreateResponse(WebRequest request)
NUnit Adapter 3.0.8.0 executing tests is finished
========== Run test finished: 1 run (0:02:06.214) ==========
我查了一下,我的装配都是最新的。这些包括Webdriver(2.53()),Webdriver.Support(2.53),IEDriver(2.53),ChromeDriver(2.21)和Nunit(3.2.1)。 Firefox和Chrome都在运行。奇怪的是,当我看到它们时,我可以手动点击测试的第一个位置,在这样做之后,测试似乎是最重要的“醒来”。并正确完成。以前有人遇到过这个吗?