0
votes

We are trying to migrate our system to WebDriver from Selenium 1. Thorough the Hudson slave an error message appeared, but the test run fine in eclipse.

Environments:

  • Hudson master: Linux machine
  • Hudson slave: windows 7, x86

Java version: 1.7.0_03

System: A new Hudson job was set up for the task, with the same configurations as it was for Selenium 1 test suites. The job executes a target from the build.xml file. clean,makedir and compile targets were ran successfully. On executing the tests the following error message appeared on Hudson Console:

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

The error:

Error Message

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)

The java code for the test:

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
    }
}

We have tried to run the test without "profile" and the same error message appeared.

Thanks in advance.

1

1 Answers

0
votes

Problem solved. There were some jar libraries included which were used for compiling by -javac (in the ant script), but not by eclipse.

Solution: Check the jar files one-by-one,and delete the unnecessary ones from the lib folder.