Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
import org.openqa.selenium.Platform;
import org.openqa.selenium.remote.BrowserType;
import org.openqa.selenium.remote.CapabilityType;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
driver = {
def capabilities = new DesiredCapabilities();
capabilities.setCapability(CapabilityType.BROWSER_NAME, BrowserType.FIREFOX);
capabilities.setCapability(CapabilityType.PLATFORM_NAME, Platform.LINUX);
capabilities.setCapability("screenResolution", "1280x720");
capabilities.setCapability("tz", "Asia/Tokyo");
def remoteWebDriverUrl = new URL("http://localhost:4444/wd/hub")
new RemoteWebDriver(remoteWebDriverUrl, capabilities)
}
@Grapes([
@Grab("org.gebish:geb-core:2.1"),
@Grab("org.seleniumhq.selenium:selenium-chrome-driver:3.11.0"),
@Grab("org.seleniumhq.selenium:selenium-support:3.11.0")
])
import geb.Browser
Browser.drive {
go "http://gebish.org"
assert title == "Geb - Very Groovy Browser Automation"
$("div.menu a.manuals").click()
waitFor { !$("#manuals-menu").hasClass("animating") }
$("#manuals-menu a")[0].click()
assert title.startsWith("The Book Of Geb")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.