Reputation: 185
I am trying to get the Groovy based browser automation / testing framework up and running and I am having an issue getting the ConfigSlurper based config working.
I have a GebConfig.groovy class in my default package as follows:
import org.openqa.selenium.firefox.FirefoxDriver
// default is to use firefox
driver = { new FirefoxDriver() }
//set the report output directory
reportsDir = "reports/"
But trying to run a script causes the following error:
Caused by: groovy.lang.MissingMethodException: No signature of method: groovy.util.ConfigSlurper.parse() is applicable for argument types: (script135050580006143429828, java.net.URL) values: [script135050580006143429828@21f11507, file:/Users/alex/Documents/workspace/gebTest/src/main/java/GebConfig.groovy]
Possible solutions: parse(java.net.URL), parse(groovy.lang.Script, java.net.URL), parse(groovy.lang.Script), parse(java.lang.Class), parse(java.lang.String), parse(java.util.Properties)
at geb.ConfigurationLoader.loadRawConfig(ConfigurationLoader.groovy:295)
I figure I need to be missing something small and obvious. I am using the latest version of Geb (0.7.2) and Groovy 1.8 in Eclipse.
Upvotes: 0
Views: 5698
Reputation: 10402
As I can see from your exception and the path to the script you seem to be using Maven or Gradle to build your project. To solve your issue you should try moving your GebConfig.groovy script from the folder src/main/java
to src/main/resources
or even better src/test/resources
since you probably do not want to have this script in your production environment.
See the Configuration chapter in The Book of Geb for further details.
Upvotes: 1