虽然在本地我们没有遇到任何问题,但在虚拟服务器上我们正在运行 Jenkins,它启动 Selenium Grid 来执行我们的一些测试。
调用的目标已引发异常。-> 服务器无响应
每隔一段时间,通常是在点击事件中,我会因为一个大的 Selenium 错误而导致测试失败。我没有运气在本地复制它,并且对于如何继续修复它有点茫然。我将包括以下错误:
Exception has been thrown by the target of an invocation. -> No response from server for url http://vm-selgrid3:5555/wd/hub/session/0894b06e-6e4f-46bc-ba82-f72a75deeb8d/element/12/click
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> OpenQA.Selenium.WebDriverException: No response from server for url http://vm-selgrid3:5555/wd/hub/session/0894b06e-6e4f-46bc-ba82-f72a75deeb8d/element/12/click
at OpenQA.Selenium.Remote.HttpCommandExecutor.CreateResponse(WebRequest request)
at OpenQA.Selenium.Remote.HttpCommandExecutor.Execute(Command commandToExecute)
at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
at OpenQA.Selenium.Remote.RemoteWebElement.Click()
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at OpenQA.Selenium.Support.PageObjects.PageFactory.ProxiedWebElementInterceptor.Intercept(IInvocation invocation)
at Castle.DynamicProxy.AbstractInvocation.Proceed()
at Castle.Proxies.IWrapsElementProxy.Click()