Quote

"Between stimulus and response there is a space. In that space is our power to choose our response.
In our response lies our growth and freedom"


“The only way to discover the limits of the possible is to go beyond them into the impossible.”


Thursday 11 December 2014

NoClassDefFoundError on Missing selenium-server-standalone JAR

Adding selenium-java-x.xx.x.jar makes it look like all is well and the script is ready to kick. However, when we run the program following error is returned:
 
Exception in thread "main" java.lang.NoClassDefFoundError: com/google/common/base/Function

The error returned is because of missing selenium-server-standalone-x.xx.x.jar missing from the class/build path. If you are using eclipse add the selenium-server-standalone-x.xx.x.jar to the project libraries using the following steps:

  1. Right Click on the project
  2. Click Properties
  3. Click on Java Build Path
  4. Click on the Libraries tab
  5. Click on Add External JARs...
  6. Navigate to the directory with 'selenium-server-standalone-x.xx.x.jar'
  7. Select the file and click Open
  8. Click Ok

Now run the script and the "Exception in thread "main" java.lang.NoClassDefFoundError: com/google/common/base/Function" error will be gone.

No comments:

Post a Comment