整个盖布迷迷糊糊的一天。我对Grails的2.3.11。实际上,我怎么正确安装盖布?我下载的jar文件,其中包括他们,但是当我尝试运行我的代码,我得到的ClassNotFoundException上org.openqa.selenium.WebDriverException
我使用的IntelliJ IDEA如果该事项。
Gebtest.groovy
package gebish
import geb.Browser
class Gebtest {
public static void main(String[] args) {
println "Hi!"
Browser.drive {
go "http://gebish.org"
assert title == "Geb - Very Groovy Browser Automation"
}
}
}
错误
Exception in thread "main" java.lang.NoClassDefFoundError: org/openqa/selenium/WebDriverException
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:344)
at org.codehaus.groovy.runtime.callsite.CallSiteArray$1.run(CallSiteArray.java:65)
at org.codehaus.groovy.runtime.callsite.CallSiteArray$1.run(CallSiteArray.java:62)
at java.security.AccessController.doPrivileged(Native Method)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.createCallStaticSite(CallSiteArray.java:62)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.createCallSite(CallSiteArray.java:159)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:45)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)
at gebish.Gebtest.main(Gebtest.groovy:6)
Caused by: java.lang.ClassNotFoundException: org.openqa.selenium.WebDriverException
at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 11 more
我也用的Grails 2.3.11,得到了创业板运行。它已经有一段时间,所以我不知道到底需要什么,但这里是我BuildConfig.groovy的某些部分可能有关:
def gebVersion = "0.13.1"
def webdriverVersion = "2.53.1"
dependencies {
compile "org.codehaus.groovy:groovy-backports-compat23:2.4.13"
test "org.gebish:geb-spock:${gebVersion}"
test "org.seleniumhq.selenium:selenium-support:${webdriverVersion}"
test "org.seleniumhq.selenium:selenium-chrome-driver:${webdriverVersion}"
test "org.seleniumhq.selenium:selenium-firefox-driver:${webdriverVersion}"
test "org.seleniumhq.selenium:selenium-ie-driver:${webdriverVersion}"
test "org.spockframework:spock-grails-support:0.7-groovy-2.0"
}
plugins {
test(":spock:0.7") {
exclude "spock-grails-support"
}
test "org.grails.plugins:geb:${gebVersion}"
}