Skip to content

Instantly share code, notes, and snippets.

@behrangsa
Created August 1, 2012 11:11
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save behrangsa/3225860 to your computer and use it in GitHub Desktop.
Save behrangsa/3225860 to your computer and use it in GitHub Desktop.
A groovy script for testing ChromeDriver
import org.openqa.selenium.chrome.ChromeDriverService;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
@Grapes(
@Grab(
group='org.seleniumhq.selenium',
module='selenium-chrome-driver',
version='2.5.0'
)
)
class ChromeDriverTester {
public static void main(String[] args) {
def service = new ChromeDriverService.Builder()
.usingChromeDriverExecutable(new File("/usr/local/bin/chromedriver"))
.usingAnyFreePort()
.build();
service.start();
def driver = new RemoteWebDriver(service.getUrl(), DesiredCapabilities.chrome());
driver.get("http://www.yahoo.com");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment