Skip to content

Instantly share code, notes, and snippets.

@crazy4groovy
Created February 7, 2012 17:50
Show Gist options
  • Save crazy4groovy/1760976 to your computer and use it in GitHub Desktop.
Save crazy4groovy/1760976 to your computer and use it in GitHub Desktop.
Sample Geb driver for Firefox
@Grapes([
@Grab("org.codehaus.geb:geb-junit4:0.6.2"),
@Grab("junit:junit-dep:4.8.2"),
@Grab("org.seleniumhq.selenium:selenium-firefox-driver:2.15.0"),
@Grab("org.seleniumhq.selenium:selenium-support:2.15.0")
])
import geb.Browser
Browser.drive {
go "http://www.google.ca/"
println $("div.jsb input").size()
assert $("div.jsb input").size() == 2
/***
$("form.login").with {
username = "admin"
password = "password"
login().click()
}
assert $("h1").text() == "Admin Section"
***/
println 'Done'
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment