Skip to content

Instantly share code, notes, and snippets.

@aya-eiya
Last active August 29, 2015 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aya-eiya/a7810129dc953541c24a to your computer and use it in GitHub Desktop.
Save aya-eiya/a7810129dc953541c24a to your computer and use it in GitHub Desktop.
Groovyのちょっとしたこと「gebでhtmlUnitのオプションを設定する方法」 ref: http://qiita.com/aya_eiya/items/eea2201724cc3556d098
import geb.driver.DriverRegistry
import geb.driver.NameBasedDriverFactory
driver = (Settings.gebDriver)?Settings.gebDriver:'firefox'
if(driver=='htmlunit'){
driver = {
def htmlunitDriver = new NameBasedDriverFactory(classLoader,'htmlunit').getDriver()
htmlunitDriver.webClient.options.setJavaScriptEnabled(true)
htmlunitDriver.webClient.options.setThrowExceptionOnScriptError(false)
htmlunitDriver.webClient.options.setUseInsecureSSL(true)
htmlunitDriver
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment