Created
September 16, 2019 07:29
-
-
Save tourdedave/ed572f5db61551ce8a6662295b78b3bf to your computer and use it in GitHub Desktop.
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
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