2016-10-09 49 views
-1

錯誤是無法打開mozila火狐48.2使用硒的webdriver 2.45.0

無法打開mozila火狐48.2使用硒的webdriver 2.45.0

這是我的代碼:

import org.openqa.selenium.WebDriver; 
import org.openqa.selenium.firefox.FirefoxDriver; 

public class OpenBrowser { 

    public static void main(String[] args) throws InterruptedException { 

     WebDriver Driver = new FirefoxDriver(); 
     Driver.get("https://www.google.com/"); 
     Thread.sleep(5000L); 
     } 

} 
+0

你應該從這個鏈接升級版本硒以及 –

+0

下載Firefox https://ftp.mozilla.org/pub/firefox/releases/46.0.1/win64-EME-free/en-GB/Firefox %20Setup%2046.0.1.exe,然後再試一次 – thebadguy

回答

0

47之後的Firefox版本與低於2.53的Selenium版本不兼容(包括這個版本) 所以你需要下載selenium3 beta和config運行geckodriver來運行firefox(就像你會用chromedriver爲驅動程序做的那樣。 https://github.com/mozilla/geckodriver/releases

+0

謝謝。現在我懂了。 –