I'm learning Geb (and Groovy) coming from a Java background, and I feel like I understand how Geb works, but I'm failing to even get the simplest configuration working.
Basically, I'm getting the following error:
Caught: java.lang.NoClassDefFoundError: geb/error/GebException
java.lang.NoClassDefFoundError: geb/error/GebException
at DriveIt.run(DriveIt.groovy:15)
Caused by: java.lang.ClassNotFoundException: geb.error.GebException
... 1 more
My class is very simple:
import groovy.grape.Grape
// I have these out of desperation
Grape.grab(group:"org.gebish", module:"geb-core", version:"0.9.3")
Grape.grab(group:"org.seleniumhq.selenium", module:"selenium-firefox-driver", version:"2.41.0")
Grape.grab(group:"org.seleniumhq.selenium", module:"selenium-support", version:"2.41.0")
// basic imports here
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.*;
import geb.Browser;
Browser.drive {
go "http://www.google.com"
}
With this simple code i get an error on the "Browser.drive" line.
This is what my GebConfig.groovy file looks like:
import org.openqa.selenium.chrome.ChromeDriver
import org.openqa.selenium.firefox.FirefoxDriver
driver = {
def driver = new ChromeDriver()
driver
}
baseUrl = 'http://localhost:8080/'
reportsDir = 'target/geb-reports'
And one more note, I'm using Eclipse, I do have the geb-code jar correctly imported in the classpath as well.
I don't seem to be doing anything incorrectly, but for the life of me, I can't figure out why I get an error saying "Browser" not recognized.
Any help??? please!!