没有方法签名:groovy.util.ConfigObject.plus()适用于参数类型:(java.lang.String)values:[/ searchpage?s =]

时间:2016-04-18 14:27:43

标签: groovy geb

我使用loadData()

进行geb测试时出现此错误
No signature of method: groovy.util.ConfigObject.plus() is applicable for argument 

types: (java.lang.String) 
values: [/searchpage?s=] 
Possible solutions: plus(java.util.Map), plus(java.util.Collection), values(), put(java.lang.Object, java.lang.Object), is(java.lang.Object), use([Ljava.lang.Object;)

守则:

@Test
void canDoSearch() {
    driver.manage().window().setSize(new Dimension(1100, 1080));
    def url = browser.config.rawConfig.baseUrl + "/searchpage?s=" + terms[rand.nextInt(terms.length)]
    go url
    $("#productsSortBy").click()
    $("form").sortBy='newest'
    waitFor{!$(".ajax-loading")}
    at SearchResultsPage
}

1 个答案:

答案 0 :(得分:2)

看起来browser.config.rawConfig.baseUrl不是字符串。请尝试拨打toString()