import geb.Browser
import org.openqa.selenium.firefox.FirefoxDriver
Browser.drive {
go "google.com"
}
我运行上面的脚本并收到以下错误:java.lang.NoClassDefFoundError: org/openqa/selenium/TakesScreenshot
答案 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 junit
和hamcrest
你还需要在类路径中添加groovy,因为geb在封面下使用它