2012-10-19 45 views
0
import geb.Browser 
import org.openqa.selenium.firefox.FirefoxDriver 

Browser.drive { 
    go "google.com" 
} 

我運行上面的腳本,並出現以下錯誤:因爲它說的documentation pagejava.lang.NoClassDefFoundError: org/openqa/selenium/TakesScreenshotGroovy代碼:要導入的庫

+0

你抓住所有的要求,[文檔中所示(http://www.gebish.org/蓋下添加到類路徑手動/電流/ intro.html#installation__usage)? –

+0

@tim_yates我也下載了硒支持jar,但是我沒有找到TakesScreenshot類。 –

+0

是的,我認爲這是在'硒api' –

回答

1

(和它的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 

硒API depends on谷歌番石榴

和含硒載體depends onjunithamcrest

您還需要常規的GEB使用它

+0

我使用NetBeans並且在我的課程路徑中確實很常見。也許它太舊了? –

+0

你有什麼版本的Groovy? –

+0

Groovy版本1.6.4 –