Groovy: General error during conversion : MacroTransformation cannot be run. ( Using Groovy in eclipse)

673 Views Asked by At

I am quite new to the groovy and trying to set up a maven project to automate the web applications using Geb-Groovy-Maven. So far I have completed the following steps:

  1. Created a Groovy project in Eclipse and configured it as Maven project. (Groovy has been installed on eclipse and I've confirmed that programs are running successfully.)

  2. Configured the pom.xml file by adding all the required dependencies.

  3. Created a new groovy class by right clicking on src file. Wrote the script to launch the webdriver using Geb.

    import geb.Browser
    import org.openqa.selenium.firefox.FirefoxDriver
    def browser = new Browser(driver: new FirefoxDriver())
    

Code:

See the code here

Error message:

Complete error message

1

There are 1 best solutions below

0
Andrew Ortega On

I've had the same problem with Groovy while studying Spring and trying Groovy code examples from the book. Thanks to emilles here, I've managed to fix the problem.

I have:

  • Eclipse IDE,
  • Groovy Development Tools 4.6.0,
  • A 'groovy' plugin defined in my Gradle script,
  • 'org.codehaus.groovy:groovy-all:3.0.12' as a Gradle dependency.

In project settings, the Groovy compiler version is 3.0.

What actually helped: Window > Preferences > Groovy > Compiler > Switch to 3.0.11.