Currently Browsing

Posts Tagged ‘ NoSuchMethodError ’

Local test run – Maven – NoSuchMethodError during driver creation

When you are getting the following exception during firefoxdriver initialization:

java.lang.NoSuchMethodError: org.openqa.selenium.Proxy.extractFrom(Lorg/openqa/selenium/Capabilities;)Lorg/openqa/selenium/Proxy;
        at org.openqa.selenium.firefox.FirefoxDriver.dropCapabilities(FirefoxDriver.java:313)
        at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:191)
        at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:186)
        at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:103)
        at test.java.com.ch.forsight.main.TestBase.getLocalDriver(TestBase.java:85)
        at test.java.com.ch.forsight.main.TestBase.createDrivers(TestBase.java:72)  

try to put this dependency into pom.xml:

        <dependency>
            <groupId>org.seleniumhq.selenium</groupId>
            <artifactId>selenium-firefox-driver</artifactId>
            <version>2.43.1</version>
        </dependency>

If you still getting the same exception you should try to experiment with the order of the imports.
Sometimes small order changes can make the project work again, who knows which one depends on an old utility…