I am trying to run a basic example for the Geb library (http://www.gebish.org/manual/current/intro.html#introduction). Here is the code:
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("al") assert firstLink.text() == "Wikipedia" // click the link firstLink.click() // wait for Google javascript to redirect to Wikipedia waitFor { title == "Wikipedia" } }
When I try to run this (using Eclipse groovy support), I get the following exception:
Caught: groovy.lang.MissingMethodException: No signature of method: static geb.Browser.drive() is applicable for argument types: (ExampleScript$_run_closure1) values: [ ExampleScript$_run_closure1@2a62610b ] Possible solutions: drive(groovy.lang.Closure), drive(geb.Browser, groovy.lang.Closure), drive(geb.Configuration, groovy.lang.Closure), drive(java.util.Map, groovy.lang.Closure), print(java.lang.Object), print(java.io.PrintWriter) groovy.lang.MissingMethodException: No signature of method: static geb.Browser.drive() is applicable for argument types: (ExampleScript$_run_closure1) values: [ ExampleScript$_run_closure1@2a62610b ] Possible solutions: drive(groovy.lang.Closure), drive(geb.Browser, groovy.lang.Closure), drive(geb.Configuration, groovy.lang.Closure), drive(java.util.Map, groovy.lang.Closure), print(java.lang.Object), print(java.io.PrintWriter) at ExampleScript.run(ExampleScript.groovy:21)
I think this suggests that the closure I pass to the static groovy.lang.Closure method is not compatible with the groovy.lang.Closure type, but I donβt know why. Simple groovy hello world scripts work fine, but passing a closure to a method always returns a similar error.
source share