我正在使用Chrome浏览器尝试点击“打印”button的Selenium应用程序,但试图点击链接时出现exception,如下所示:
<a href="javascript:printDoc()">Print</a>
应用程序以这种方式点击链接:
var printOption = browser.FindElement(By.XPath("//*[@id='printLink']/div[1]/a")); printOption.Click();
在最后一条指令中出现以下错误:
OpenQA.Selenium.WebDriverException: The HTTP request to the remote WebDriver server for URL http://localhost:65480/session/db0e763311af8fdd4f0ca06d79365d85/element timed out after 60 seconds. ---> System.Net.WebException: The operation has timed out at System.Net.HttpWebRequest.GetResponse() at OpenQA.Selenium.Remote.HttpCommandExecutor.CreateResponse(WebRequest request) --- End of inner exception stack trace --- at OpenQA.Selenium.Remote.HttpCommandExecutor.CreateResponse(WebRequest request) 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.By.FindElement(ISearchContext context)
任何意见或build议,将不胜感激。