2016-09-14 89 views
1

試圖執行下列硒腳本結果運行該腳本在WebDriverException不能在月食

package package1; 

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


public class Class1 { 

    public static void main(String[] args) { 

     WebDriver driver= new FirefoxDriver(); 

     driver.manage().window().maximize(); 

     driver.close(); 

    } 

} 

引發的異常是

org.openqa.selenium.WebDriverException: Unable to bind to locking port 7054 within 45000 ms 
at org.openqa.selenium.internal.SocketLock.lock(SocketLock.java:99) 
at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:80) 
at org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:271) 
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:119) 
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:218) 
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:211) 
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:207) 
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:120) 
at package1.Class1.main(Class1.java:12) 

這究竟是爲什麼?

使用版本 - 1.8.0_101的java文件 霓虹燈蝕 2.53硒jar文件

+0

的可能重複之前開始與Firefox的驅動程序中的硒服務器[無法綁定到鎖定端口7054在45000毫秒](http://stackoverflow.com/questions/16140865/unable-to-bind-to-locking-port-7054-within-45000-ms) –

回答