3

Geb を使い始めたばかりで、Book of Geb からサンプル コードを入力すると、次のエラーが発生します。

import geb.Browser


Browser.drive {
    go "http://google.com/ncr"

    // make sure we actually got to the page
    assert title == "Google"

    // enter wikipedia into the search field
    $("input", name: "q").value("wikipedia")

    // wait for the change to results page to happen
    // (google updates the page dynamically without a new request)
    waitFor { title.endsWith("Google Search") }

    // is the first link to wikipedia?
    def firstLink = $("li.g", 0).find("a.l")
    assert firstLink.text() == "Wikipedia"

    // click the link
    firstLink.click()

    // wait for Google's javascript to redirect to Wikipedia
    waitFor { title == "Wikipedia" }
}

この例外が発生しています:

Caught: java.lang.IncompatibleClassChangeError: the number of constructors during runtime and compile time for java.lang.Exception do not match. Expected 4 but got 5
    at geb.error.GebException.<init>(GebException.groovy:20)
    at geb.waiting.WaitTimeoutException.<init>(WaitTimeoutException.groovy:30)
    at geb.waiting.Wait.waitFor(Wait.groovy:108)
        .......

何か案は?ありがとう!

4

2 に答える 2

12

ひょっとしてJava 7を使っていますか?< Java 7 でコンパイルされた例外を使用する Groovy コードは、Java 7 と互換性がありません。

于 2011-10-19T20:32:54.940 に答える
1

Geb は 0.7.1 の時点で Java7 と互換性があります。それを下回っている場合は、アップグレードする必要があります。SE: http://jira.codehaus.org/browse/GEB-194

于 2013-02-12T13:50:12.187 に答える