Last active
August 29, 2015 14:22
-
-
Save aya-eiya/a7810129dc953541c24a to your computer and use it in GitHub Desktop.
Groovyのちょっとしたこと「gebでhtmlUnitのオプションを設定する方法」 ref: http://qiita.com/aya_eiya/items/eea2201724cc3556d098
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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