We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 769699a commit c047319Copy full SHA for c047319
examples/javascript/test/interactions/windows.spec.js
@@ -49,4 +49,15 @@ describe('Interactions - Windows', function () {
49
base64Code = encodedString.slice(startIndex, endIndex)
50
assert.strictEqual(base64Code, imgMagicNumber)
51
});
52
+
53
+ it('Should be able to takeScreenshot', async function () {
54
+ await driver.get('https://www.selenium.dev/selenium/web/javascriptPage.html');
55
56
+ // Captures the screenshot
57
+ let encodedString = await driver.takeScreenshot();
58
+ // save screenshot as below
59
+ // await fs.writeFileSync('./image.png', encodedString, 'base64');
60
+ base64Code = encodedString.slice(startIndex, endIndex)
61
+ assert.strictEqual(base64Code, imgMagicNumber)
62
+ });
63
0 commit comments