Not able to launch Firefox using ANT. Getting "java.lang.IncompatibleClassChangeError".

26 views
Skip to first unread message

Lakshmikanth Ak

unread,
Dec 13, 2016, 6:00:33 PM12/13/16
to webdriver
Not able to launch Firefox using ANT. Getting "java.lang.IncompatibleClassChangeError".

Softwares Version
Eclipse 4.5.0
JDK 1.8.0
JRE 1.8.0
Selenium 2.53.0
TestNG 6.9.9
FireFox 46.0.1

Code : 

@Test
public void Browser() {
FirefoxDriver driver=new FirefoxDriver();
driver.get("http://flipkart.com");
driver.quit();

}

Please help me to resolve the issue.

Note : Using same versions am able to run the code directly from eclipse and working as expected without any issues.
If i run the code from Ant getting above mentioned error.

Complete Error trace :

java.lang.IncompatibleClassChangeError: Class org.openqa.selenium.remote.DesiredCapabilities does not implement the requested
interface org.openqa.selenium.Capabilities
at org.openqa.selenium.firefox.FirefoxDriver.dropCapabilities(FirefoxDriver.java:324)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:217)
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 test.NewTest.Browser(NewTest.java:10)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:639)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:816)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1124)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108)
at org.testng.TestRunner.privateRun(TestRunner.java:774)
at org.testng.TestRunner.run(TestRunner.java:624)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:359)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:354)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:312)
at org.testng.SuiteRunner.run(SuiteRunner.java:261)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1215)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1140)
at org.testng.TestNG.run(TestNG.java:1048)
at org.testng.TestNG.privateMain(TestNG.java:1355)
at org.testng.TestNG.main(TestNG.java:1324)

darrell grainger

unread,
Dec 14, 2016, 10:28:37 AM12/14/16
to webdriver
It looks like the setup of libraries in your classpath is correct in Eclipse but it not set correctly in Ant. You need to figure out how to configure how Ant compiles Java code correctly. This isn't really a Selenium/WebDriver. You might want to find a good forum for Ant and see if there are Ant experts who can help you with configuring your Ant scripts.
Reply all
Reply to author
Forward
0 new messages