我試圖將Chrome設爲我的瀏覽器與webdriver的測試並正確設置chromedriver.exe文件,但我仍然得到以下錯誤:如何設置谷歌瀏覽器中的webdriver
org.openqa.selenium.WebDriverException:
The path to the driver executable must be set by the webdriver.chrome.driver system property;
for more information, see http://code.google.com/p/selenium/wiki/ChromeDriver.
The latest version can be downloaded from http://code.google.com/p/chromedriver/downloads/list
我已經檢查過驅動程序的路徑,但仍然收到相同的錯誤。
我不知道我犯了什麼錯誤。
這裏是我的代碼:
File file = new File("C:\\chromedriver.exe");
System.setProperty("webdriver.chrome.driver", file.getAbsolutePath());
Capability= DesiredCapabilities.chrome();
Capability.setBrowserName("chrome");
Capability.setPlatform(Platform.LINUX);
browser=new RemoteWebDriver(new URL(nodeURL),Capability);
browser.get(webUrl);
請幫助我!
很抱歉,如果這是要求明顯,但:你有_chromedriver.exe_在C:\驅動器? –
是的,我有這個文件具有相同的名稱! – Aditya
你似乎混合了'ChromeDriver'和'RemoteWebDriver'。你能描述你想要達到的目標嗎? –