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:
Now run the script and the "Exception in thread "main" java.lang.NoClassDefFoundError: com/google/common/base/Function" error will be gone.
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:
- Right Click on the project
- Click Properties
- Click on Java Build Path
- Click on the Libraries tab
- Click on Add External JARs...
- Navigate to the directory with 'selenium-server-standalone-x.xx.x.jar'
- Select the file and click Open
- 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