Skip to content

Instantly share code, notes, and snippets.

@tourdedave
Created September 16, 2019 07:29
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 tourdedave/ed572f5db61551ce8a6662295b78b3bf to your computer and use it in GitHub Desktop.
Save tourdedave/ed572f5db61551ce8a6662295b78b3bf to your computer and use it in GitHub Desktop.
const { Builder } = require('selenium-webdriver')
const fs = require('fs')
const path = require('path')
async function run() {
const driver = await new Builder()
.withCapabilities({
'se:ieOptions': {
'ie.enableFullPageScreenshot': false
}
})
.forBrowser('internet explorer')
.build()
try {
await driver.get('http://the-internet.herokuapp.com')
const fileName = path.join(__dirname, 'screenshot.jpg')
fs.writeFileSync(fileName, await driver.takeScreenshot(), "base64")
} finally {
await driver.quit()
}
}
run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment