2014-05-21 2 views
0

firefox를 사용하려고하는 여러 webdriver 테스트를 실행하려고하면 문제가 발생합니다. 여러 firefox webdriver 테스트를 실행하는 방법

다음

내가 다음

Exception in thread "main" org.openqa.selenium.WebDriverException: Unable to bind to locking port 7054 within 45000 ms 
Build info: version: '2.41.0', revision: '3192d8a', time: '2014-03-27 17:18:15' 
System info: host: 'ip-172-31-23-96.us-west-2.compute.internal', ip: '172.31.23.96', os.name: 'Linux', os.arch: 'amd64', os.version: '3.13.0-24-generic', java.version: '1.7.0_55' 
Driver info: driver.version: FirefoxDriver 
    at org.openqa.selenium.internal.SocketLock.lock(SocketLock.java:98) 
    at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:84) 
    at org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:246) 
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:114) 
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:193) 
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:186) 
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:182) 
    at feedbackWorksproperly.main(feedbackWorksproperly.java:23) 


sudo javac -cp ".:/includes/selenium-2.41.0/selenium-java-2.41.0-srcs.jar:/includes/selenium-2.41.0/selenium-java-2.41.0.jar:/includes/selenium-2.41.0/libs/*" feedbackWorksproperly.java 

sudo java -cp ".:/includes/selenium-2.41.0/selenium-java-2.41.0-srcs.jar:/includes/selenium-2.41.0/selenium-java-2.41.0.jar:/includes/selenium-2.41.0/libs/*" feedbackWorksproperly  

를 얻을 나는 요청에 따라 테스트를 실행하는 나머지 서버가 나는 webdriver에게

String Xport = System.getProperty("lmportal.xvfb.id", ":1"); 
    final File firefoxPath = new File(System.getProperty("lmportal.deploy.firefox.path", 
     "/usr/bin/firefox")); 
    FirefoxBinary firefoxBinary = new FirefoxBinary(firefoxPath); 
    firefoxBinary.setEnvironmentProperty("DISPLAY", Xport); 
    FirefoxDriver wd; 
    wd = new FirefoxDriver(firefoxBinary, null); 

주를 초기화하는 방식 오류입니다. 그래서 자바 코드를 포함하는 요청을받을 때마다 서버에서 현재 실행중인 다른 테스트와 독립적으로 테스트를 실행합니다.

+0

미안 해요, 난 정확히 어떻게하면 "여러 webdriver 테스트"를하지 않았다? – olyv

답변

1

두 드라이버를 동시에 실행하고 있다고 생각하십니까? 이 경우 다른 하나는 동일한 포트에서 실행되는 것처럼 ,

Unable to bind to locking port 7054

보인다. 다른 포트를 사용하면 작동 할 수 있습니다. 병렬

그러나 나는 다른 브라우저에서 테스트를 실행하는 셀레늄 그리드를 사용하는 것이 좋습니다/
참조 http://code.google.com/p/selenium/wiki/Grid2

관련 문제