【发布时间】:2017-01-22 01:36:40
【问题描述】:
我正在使用运行 firefox 41.0.2 的 firefox webdriver 单元 3.4.1 硒 2.47.0 规范流 2.1.0 我的测试并行运行。
几天过去了,我的测试在通过 jenkins 运行时未能完成,运行卡在一个进程上,无法继续运行的其余部分。在运行 20 多个场景时,我间歇性地能够在本地重现错误。我收到以下异常,有没有人见过这个问题?
OpenQA.Selenium.WebDriverException : 向远程 WebDriver 服务器发送 HTTP 请求以获取 URL http://localhost:7056/hub/session/d0a83b9c-bd79-4218-8eac-dc8b273f8f40/element/%7B84966a91-06c4-42dd-98c0-278ed35e3667%7D/attribute/value,引发了具有空响应的异常。
异常状态为ConnectFailure,消息为:无法连接到远程服务器 ----> System.Net.WebException:无法连接到远程服务器 ----> System.Net.Sockets.SocketException : 无法建立连接,因为目标机器主动拒绝它 127.0.0.1:7056
++++++++++++++++++++++ 堆栈跟踪: 在 OpenQA.Selenium.Remote.HttpCommandExecutor.CreateResponse(WebRequest 请求) 在 OpenQA.Selenium.Firefox.FirefoxDriverCommandExecutor.Execute(命令 commandToExecute) 在 OpenQA.Selenium.Remote.RemoteWebDriver.Execute(字符串 driverCommandToExecute,Dictionary
2 parameters) at OpenQA.Selenium.Remote.RemoteWebElement.GetAttribute(String attributeName) at TeamHours.Automation.StandAlone.WebComponents.Pages.WeeklySalesForecastPage.<Save>b__0(IWebElement s) in c:\Program Files (x86)\Jenkins\jobs\Automation Build Develop\workspace\TeamHours.Automation.StandAlone.WebComponents\Pages\WeeklySalesForecastPage.cs:line 38 at System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext() 在 System.Linq.Enumerable.Any[TSource](IEnumerable1 source, Func2 谓词) 在 c:\Program Files (x86)\Jenkins\jobs\Automation Build Develop\workspace\TeamHours.Automation.StandAlone.WebComponents\Pages\WeeklySalesForecastPage.cs 中的 TeamHours.Automation.StandAlone.WebComponents.Pages.WeeklySalesForecastPage.Save():第 39 行 在 TeamHours.Automation.StandAlone.CommonSteps.Steps.SalesForecast.WeeklySalesForecastGraphsSteps.WhenISaveTheForecast() 在 c:\Program Files (x86)\Jenkins\jobs\Automation Build Develop\workspace\TeamHours.Automation.StandAlone.CommonSteps\Steps\SalesForecast\ WeeklySalesForecastGraphsSteps.cs:第 73 行 在 TechTalk.SpecFlow.Bindings.BindingInvoker.InvokeBinding(IBinding 绑定,IContextManager contextManager,Object[] 参数,ITestTracer testTracer,TimeSpan& 持续时间) 在 TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.ExecuteStepMatch(BindingMatch 匹配,对象 [] 参数) 在 TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.ExecuteStep(StepInstance stepInstance) 在 TechTalk.SpecFlow.Infrastructure.TestExecutionEngine.OnAfterLastStep() 在 TeamHours.Automation.StandAlone.RegresionTests.Features.Schedule.ScheduleGraphFeature.ScenarioCleanup() 在 c:\Program Files (x86)\Jenkins\jobs\Automation Build Develop\workspace\TeamHours.Automation.StandAlone.RegresionTests\Features\Schedule\ ScheduleGraph.feature.cs:第 0 行 在 TeamHours.Automation.StandAlone.RegresionTests.Features.Schedule.ScheduleGraphFeature.VerifyScheduleGraphShowsCorrectPeopleAndOverstaffedWhenDemandIsExceeded(字符串角色,字符串选项卡,字符串链接,字符串 noOfItems,字符串 peopleRequired,字符串 itemsOrSales,字符串 tab2,字符串视图,字符串总计,字符串 tab3,字符串 type1, c:\Program Files (x86)\Jenkins\jobs\Automation Build Develop\workspace\TeamHours.Automation.StandAlone.RegresionTests\Features\Schedule\ScheduleGraph.feature:line 133 中的字符串 type2、String type3、String[] exampleTags) --WebException 在 System.Net.HttpWebRequest.GetResponse() 在 OpenQA.Selenium.Remote.HttpCommandExecutor.CreateResponse(WebRequest 请求) --套接字异常 在 System.Net.Sockets.Socket.DoConnect(端点 endPointSnapshot,SocketAddress socketAddress) 在 System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& 套接字, IPAddress& 地址, ConnectSocketState 状态, IAsyncResult asyncResult, Exception& 异常)
【问题讨论】: