gpt4 book ai didi

java - Geb - IncompatibleClassChangeError

转载 作者:塔克拉玛干 更新时间:2023-11-01 21:30:58 25 4
gpt4 key购买 nike

我刚开始使用 Geb,在输入来自 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)
.......

有什么想法吗?谢谢!

最佳答案

您是否正在使用 Java 7?使用

关于java - Geb - IncompatibleClassChangeError,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7826967/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com