Created
February 7, 2012 17:50
-
-
Save crazy4groovy/1760976 to your computer and use it in GitHub Desktop.
Sample Geb driver for Firefox
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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