Thursday, August 8, 2013

Running Selenium with Groovy on Firefox

There is small script to run and take screenshot in Firefox with Selenium from Groovy:


@Grab("org.seleniumhq.selenium:selenium-firefox-driver:2.34.0")

import org.openqa.selenium.firefox.FirefoxDriver
import org.openqa.selenium.*
 
new FirefoxDriver().with {
 get("http://www.google.com")
 getScreenshotAs(OutputType.FILE).renameTo("screenshot.png")
 quit()
}


No comments:

Post a Comment