Skip to content

Instantly share code, notes, and snippets.

@ganta
Created July 31, 2013 16:30
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 ganta/6123642 to your computer and use it in GitHub Desktop.
Save ganta/6123642 to your computer and use it in GitHub Desktop.
Ghost DriverでUser-Agentを変更する設定
import org.openqa.selenium.phantomjs.PhantomJSDriver
import org.openqa.selenium.remote.DesiredCapabilities
driver = {
def capabilities = new DesiredCapabilities()
capabilities.setCapability(
'phantomjs.page.settings.userAgent',
'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)'
)
new PhantomJSDriver(capabilities)
}
reportsDir = 'reports'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment