NoSuchMethodError: org.openqa.selenium.os.CommandLine.waitFor(J)V with webdriver v2.43.1 and FF v32

1,844 views
Skip to first unread message

Rikesh

unread,
Sep 11, 2014, 10:03:27 AM9/11/14
to seleniu...@googlegroups.com
I am encountering the following error with WebDriver v2.43.1 and Firefox v32.
java.lang.NoSuchMethodError: org.openqa.selenium.os.CommandLine.waitFor(J)V
at org.openqa.selenium.firefox.FirefoxBinary.waitFor(FirefoxBinary.java:222)
at org.openqa.selenium.firefox.FirefoxBinary.clean(FirefoxBinary.java:242)
at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.start(NewProfileExtensionConnection.java:91)
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:191)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:186)

I am not sure why as I have examined the source for CommandLine in the selenium-remote-driver jar and such a method appears to exist. Any ideas?

Krishnan Mahadevan

unread,
Sep 11, 2014, 10:51:15 AM9/11/14
to Selenium Users
You are perhaps having a mixup of CLASSPATH. Your classpath seems to be having more than one versions of the CommandLine class and perhaps an older version of this class is being resolved ahead of the newer version.

How are you managing your classpath ? Is it via Maven or is it via Ant ?

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/0b167850-5667-4e7e-9970-fa03c979d81e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Rikesh

unread,
Sep 11, 2014, 11:15:17 AM9/11/14
to seleniu...@googlegroups.com
It is via Maven.

What I am noticing when I update the version number for selenium-server in my POM is that in my .m2 folder no jars are being downloaded for selenium-remote-driver and selenium-api.  I have not previously seen this problem even when updating to v2.42.2.

Thanks & Regards

Rikesh

Gabriel Gruber

unread,
Sep 13, 2014, 2:37:29 PM9/13/14
to seleniu...@googlegroups.com
I had the same problem, it seems that the transitive dependency setup is somehow not correct when only using the dependency to selenium-java. Also adding the dependencies to selenium-remote-driver and selenium-api was my solution.

Pieter Develtere

unread,
Sep 15, 2014, 8:00:44 AM9/15/14
to seleniu...@googlegroups.com
Have the same problem. No idea how to fix it...

Op donderdag 11 september 2014 16:03:27 UTC+2 schreef Rikesh:

Krishnan Mahadevan

unread,
Sep 16, 2014, 10:04:08 AM9/16/14
to Selenium Users
Can you please share how does your <dependency> tag look like ? [ assuming you are using Maven 

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.

John Rix

unread,
Sep 17, 2014, 7:44:58 PM9/17/14
to seleniu...@googlegroups.com
Just doing a Maven 'mvn clean' after updating the selenium-java dependency version solved this problem for me. My build folder was retaining the older dependencies which were getting picked up by the class loader in preference to the new ones.

Krishnan Mahadevan

unread,
Sep 18, 2014, 4:53:14 AM9/18/14
to Selenium Users
That's weird. mvn clean is supposed to delete off your build folder [ target folder to be precise ] wherein only your scripted java classes' .class files are found. I dont think it will have any effect on the CLASSPATH [ which is from where maven resolves your referenced jars via your dependencies entry ]

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/

John Rix

unread,
Sep 18, 2014, 6:02:47 AM9/18/14
to seleniu...@googlegroups.com
Yes, it did delete my target folder, which is where the old libs were being retained and packaged into my war. That said, I am running the test suite out of the target folder in a somewhat peculiar manual fashion (after 'maven install') which might have been impacting things also.

Afser H

unread,
Sep 19, 2014, 5:01:40 AM9/19/14
to seleniu...@googlegroups.com
Use this set of dependencies. After this try to 
1) maven clean
2) Right click project folder -> Update Dependencies 



<modelVersion>4.0.0</modelVersion>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>Project</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>Project</name>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-firefox-driver</artifactId>
<version>2.43.1</version>
</dependency>
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.6</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.4</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-exec</artifactId>
<version>1.1</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-remote-driver</artifactId>
<version>2.43.1</version>
</dependency>
</dependencies>

</project>

Reply all
Reply to author
Forward
0 new messages