運行下面的代碼時,我觀察到org.openqa.selenium.WebDriverException: unknown error
異常。如何解決org.openqa.selenium.WebDriverException:未知錯誤
我不明白爲什麼會出現此錯誤,即使我使用簡單的驅動程序初始化代碼。
我使用Eclipse火星2.
我用下面的代碼:
import org.openqa.selenium.*;
import org.openqa.selenium.chrome.*;
public class APP {
public static void main(String[] args)
{
// TODO Auto-generated method stub
System.setProperty("webdriver.chrome.driver", "E:\\CDS\\Application\\chromedriver.exe");
try {
WebDriver driver = new ChromeDriver();
driver.get("http://www.google.com");
} catch (Exception e) {
// TODO Auto-generated catch block
System.out.println(e);
}
}
}
返回該錯誤
請指引我解決它的辦法。
鉻合金驅動程序版本是2.30。你正在使用最新的Chrome瀏覽器? –
我使用的是Chrome版本58.19.3029.110 –
這很奇怪...代碼看起來不錯。你可以嘗試添加一些隱含的等待並嘗試?此外,嘗試下載chromedriver 2.29和檢查 –