@Grapes([
@Grab("org.codehaus.geb:geb-core:0.7.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 {
// Load the page
go "http://www.whu.edu.cn"
// $("a") returns all hyperlinks on the page, similar to jQuery
$("a").each { a ->
// Display the required link properties and attributes
println """
The link to '${a.@href}' with text '${a.text()}' is at location (${a.x}, ${a.y}),
with a height of ${a.height}px and a width of ${a.width}px.
"""
}
}
I just created my first Groovy project in Eclipse and created my first Groovy class inside the project. Everything written for the class is as above. When I ran the script, it didn't throw any error nor would it terminate in time.
Was it trying to download all the annotated dependencies? If so, does it need to download the dependencies each time it is run? Or it is once and for all?