如何增加页面超时

时间:2016-03-29 22:39:47

标签: c# selenium-webdriver nunit

我正在编写一些webdriver测试,我的一个测试用例一直只在Firefox中出现。我正在加载页面时遇到此异常。我只是遇到这个问题与Firefox,IE和Chrome没有这个问题。由于此页面历史上需要一段时间才能加载并且超过1分钟并不是不寻常的,我怎么能将此超时增加到2分钟?我已经将Driver.Manage()。Timeout()。SetPageLoadTimeout()设置为3分钟。但是仅在1分钟后仍然看到这个超时。在观看测试运行时,似乎页面正在等待完全加载,但为什么它会在1分钟而不是3分钟超时?

Result Message: 
OpenQA.Selenium.WebDriverException : The HTTP request to the remote WebDriver server for URL http://localhost:7055/hub/session/3e09453d-26bb-4a6c-9f23-9cae9fc1ed60/element/%7B841d23a5-2842-4dec-a5d3-9575bc068e47%7D/click timed out after 60 seconds.
  ----> System.Net.WebException : The operation has timed out
Result StackTrace:  
at OpenQA.Selenium.Remote.HttpCommandExecutor.CreateResponse(WebRequest request)
   at OpenQA.Selenium.Remote.HttpCommandExecutor.Execute(Command commandToExecute)
   at OpenQA.Selenium.Firefox.FirefoxDriverCommandExecutor.Execute(Command commandToExecute)
   at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
   at OpenQA.Selenium.Remote.RemoteWebElement.Click()
   at POMAuctivaTest.TestSuite.NewUserTestSuite`1.TokenizeNewAccount() in c:\Users\jburns\Documents\Visual Studio 2013\Projects\POMAuctivaTest\POMAuctivaTest.TestSuite\NewUserTestSuite.cs:line 97
   at POMAuctivaTest.TestSuite.NewUserTestSuite`1.RegisterAndActivateNewUser() in c:\Users\jburns\Documents\Visual Studio 2013\Projects\POMAuctivaTest\POMAuctivaTest.TestSuite\NewUserTestSuite.cs:line 74
--WebException
   at System.Net.HttpWebRequest.GetResponse()
   at OpenQA.Selenium.Remote.HttpCommandExecutor.CreateResponse(WebRequest request)

0 个答案:

没有答案