下面的代碼在Firefox和Chrome中正常工作,但在IE中執行時顯示錯誤。I/O異常和無法找到元素在使用Selenium Webdriver的IE中
System.setProperty("webdriver.ie.driver", "G:\\Selenium\\IEDriver\\IEDriverServer.exe");
WebDriver driver=new InternetExplorerDriver();
driver.get("https://www.google.co.in/?gws_rd=cr&ei=ZDziUrLDEuLpiAeD44H4BA");
driver.findElement(By.name("q")).sendKeys("Selenium");
顯示的錯誤是I/O exception (java.net.SocketException) caught when processing request: Software caused connection abort: recv failed Jan 24, 2014 3:44:04 PM org.apache.http.impl.client.DefaultRequestDirector tryExecute INFO: Retrying request Exception in thread "main" org.openqa.selenium.NoSuchElementException:
什麼版本的IE? IE 11完全不受支持。 – JimEvans
IE的版本是10 – Dinu