2012-04-19 64 views
0

我們正在嘗試將我們的系統從Selenium 1遷移到WebDriver。 儘管Hudson從站出現錯誤消息,但測試在eclipse中正常運行。在Hudson從站上運行Webdriver測試之前出現錯誤

環境:

  • 哈德森高手:Linux機器
  • 哈德森奴:Windows 7中,86

Java版本:1.7.0_03

系統: 爲此任務設立了一項新的哈德森工作配置與Selenium 1測試套件相同。作業從build.xml文件執行目標。乾淨,makedir和編譯目標成功運行。 上執行的測試下面的錯誤消息上哈德森控制檯出現:

run_shopping_travel_tests: 
    [junit] Running com.example.tests.ExampleTests 
    [junit] Tests run: 1, Failures: 0, Errors: 2, Time elapsed: 2.385 sec 
    [junit] Test com.example.tests.ExampleTests FAILED 
    [junit] Running com.example.tests.Example2Test 
    [junit] Tests run: 1, Failures: 0, Errors: 2, Time elapsed: 0.752 sec 
    [junit] Test com.example.tests.Example2Test FAILED 
    [echo] selenium directory: C:\Selenium 

錯誤:

錯誤消息

LINUX 
Stacktrace 

java.lang.NoSuchFieldError: LINUX 
    at org.openqa.selenium.firefox.FirefoxBinary.isOnLinux(FirefoxBinary.java:62) 
    at org.openqa.selenium.firefox.FirefoxBinary.startProfile(FirefoxBinary.java:72) 
    at org.openqa.selenium.firefox.FirefoxBinary.clean(FirefoxBinary.java:273) 
    at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:78) 
    at org.openqa.selenium.firefox.FirefoxDriver.startClient(FirefoxDriver.java:142) 
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:85) 
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:121) 
    at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:77) 
    at com.example.tests.ExampleTests.setup(ExampleTests.java:43) 

用於測試的Java代碼:

public class ExampleTests 
{ 
    FirefoxDriver driver = null; 

    @Before 
    public void setup() { 
     File profileDir = new File("C:\\Selenium\\FirefoxProfile"); 
     FirefoxProfile profile = new FirefoxProfile(profileDir); 

     driver = new FirefoxDriver(profile); // line 43, where error appears 
    } 
    @Test 
    public void T100_VerifyExampleTest() { 
    // some test code here 
    } 
} 

我們試圖在沒有「配置文件」和相同的錯誤混亂的情況下運行測試年齡出現了。

在此先感謝。

回答

0

問題已解決。 包含了一些jar庫,它們被-javac(在ant腳本中)編譯,但不能被eclipse編譯。

解決方案: 逐個檢查jar文件,並從lib文件夾中刪除不必要的文件。

相關問題