This seems to work:
@Grapes([
@Grab("org.codehaus.geb:geb-core:0.7.2"),
@Grab("org.seleniumhq.selenium:selenium-htmlunit-driver:2.25.0"),
@Grab("org.seleniumhq.selenium:selenium-support:2.25.0"),
@Grab("org.seleniumhq.selenium:selenium-firefox-driver:2.25.0")
])
import geb.Browser
import org.openqa.selenium.firefox.FirefoxDriver
Browser.drive() {
go "http://www.google.com"
}
But how do I use FirefoxDriver instead of HtmlUnitDriver? This just starts Firefox but all the drive instructions are executed in HtmlUnitDriver…
@Grapes([
@Grab("org.codehaus.geb:geb-core:0.7.2"),
@Grab("org.seleniumhq.selenium:selenium-htmlunit-driver:2.25.0"),
@Grab("org.seleniumhq.selenium:selenium-support:2.25.0"),
@Grab("org.seleniumhq.selenium:selenium-firefox-driver:2.25.0")
])
import geb.Browser
import org.openqa.selenium.firefox.FirefoxDriver
def browser = new Browser(driver: new FirefoxDriver())
browser.drive {
go "http://www.google.com"
}
Use a configuration script as outlined here: http://www.gebish.org/manual/0.7.0/configuration.html