Groovy代码:要导入的库

时间:2012-10-19 10:57:54

标签: selenium groovy noclassdeffounderror geb

import geb.Browser
import org.openqa.selenium.firefox.FirefoxDriver

Browser.drive {
    go "google.com"
}

我运行上面的脚本并收到以下错误:java.lang.NoClassDefFoundError: org/openqa/selenium/TakesScreenshot

1 个答案:

答案 0 :(得分:1)

正如documentation page(及其maven info)所述,您需要:

org.codehaus.geb:geb-implicit-assertions:0.7.2
org.seleniumhq.selenium:selenium-api:2.15.0
org.seleniumhq.selenium:selenium-support:2.15.0

selenium-api depends on google guava

和selenium-support depends on junithamcrest

你还需要在类路径中添加groovy,因为geb在封面下使用它