0

I just want to change my build path in my groovy/gradleproject cucumber project since I have change the source from test to main (Believe this is possible)

Even after deleting the build folder and tried to re build the project. Then it created same class path and given the below error. May be because of class path issue.

Groovyc: java.lang.NoClassDefFoundError: org/openqa/selenium/WebDriver
    at java.lang.Class.getDeclaredMethods0(Native Method)
    at java.lang.Class.privateGetDeclaredMethods(Class.java:2531)
    at java.lang.Class.getDeclaredMethods(Class.java:1855)
    at org.codehaus.groovy.vmplugin.v5.Java5.configureClassNode(Java5.java:328)

enter image description here

Versions

IntelliJ : 13.0.3
Gradle 1.9
Groovy:       1.8.6

It gives below error when try to add main folder as content root enter image description here

enter image description here

Thanks

Shabar
  • 2,617
  • 11
  • 57
  • 98
  • Is webdriver, selenium-java or something, added to dependencies? Should perhaps the folders features and geb reside in src/test? Have you had a look at https://github.com/cucumber/cucumber-jvm/tree/master/examples/java-gradle ? – judoole Jul 28 '14 at 07:12
  • @judoole I added all the dependencies. Folder paths screenshot added to the question for easy reference (dependencies also there) – Shabar Jul 29 '14 at 00:34
  • Sorry for the late reply. How do you import the project in Idea? Import project and select build.gradle or using the gradle idea task? – judoole Jul 29 '14 at 20:06
  • @judoole no problem at all. By selecting `build.gradle ` – Shabar Jul 30 '14 at 03:56
  • 1
    A bit hard to see why it doesn't work, but I would start by moving the HomePageSteps.groovy and likes to src/test/groovy/cucumber. Also all the files in src/main/groovy seems to belong to src/test/groovy. And cucumber-junit is in version 1.1.8 now. Again, https://github.com/cucumber/cucumber-jvm/tree/master/examples/java-gradle is a good path to start copy pasting. – judoole Jul 30 '14 at 07:33
  • I managed to get rid of compilation error by changing the root directory [http://stackoverflow.com/questions/6104551/java-setting-classpath] and now getting runtime error. Why would you say to move the files to `src/test/groovy ` folder. Is there a particular reason? – Shabar Jul 31 '14 at 11:55
  • I'd guess .groovy files belong to src/main/groovy. Cucumber tries to find your *Steps testcode under src/test/groovy/. Further more Spec files should belong to test sources and is not productioncode. – judoole Jul 31 '14 at 12:09

0 Answers0