taiko
taiko copied to clipboard
Should not get a blank screen trying to capture a full page screenshot
Expected behavior Should not get a blank screen trying to capture a full page screenshot
Actual behavior Getting a blank screenshot when the current page is in the middle
Steps to replicate
- Run the script
const { openBrowser, goto, screenshot, scrollTo, closeBrowser } = require('taiko');
(async () => {
try {
await openBrowser();
await goto("https://www.softwarehow.com/take-full-webpage-screenshot/");
await scrollTo("Firefox Screenshots (for Firefox Users)");
await screenshot({fullPage : true});
} catch (e) {
console.error(e);
} finally {
await closeBrowser();
}
})();
Blocks #242
Version
commit - 392757a04a200680d6898dfa6ee0252a0db60fcf
Another example
const { openBrowser, goto, click, screenshot, closeBrowser } = require('taiko');
(async () => {
try {
await openBrowser();
await goto("https://docs.gauge.org/latest/writing-specifications.html");
await click("Tags");
await screenshot({fullPage : true});
} catch (e) {
console.error(e);
} finally {
await closeBrowser();
}
})();
The screenshot taken is blank
Screenshot is generated as expected.
Taiko Commit : d473050819cdea198d9481b23bde8f9ae23283d3
ScreenShot :

@Apoorva-GA Did you scroll and then capture the fullPage screenshot? If not, you need to do that to reproduce this issue. I did some debugging on this seems like a chromium issue.
@saikrishna321 I am running the script
const { openBrowser, goto, screenshot, scrollTo, closeBrowser } = require('taiko');
(async () => {
try {
await openBrowser();
await goto("https://www.softwarehow.com/take-full-webpage-screenshot/");
await scrollTo("Firefox Screenshots (for Firefox Users)");
await screenshot({fullPage : true});
} catch (e) {
console.error(e);
} finally {
await closeBrowser();
}
})();
which is doing a scroll and I am able to get the screenshot.
@Apoorva-GA It works fine when running taiko script.js and breaks on REPL
@saikrishna321 yeah, you are right.
screenshot({fullPage : true}) hangs on REPL. Will look into it.
This is a devtools bug. Please watch issue for updates.