taiko icon indicating copy to clipboard operation
taiko copied to clipboard

Should not get a blank screen trying to capture a full page screenshot

Open sswaroopgupta opened this issue 6 years ago • 7 comments
trafficstars

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

sswaroopgupta avatar Jan 16 '19 21:01 sswaroopgupta

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

sswaroopgupta avatar Jan 17 '19 15:01 sswaroopgupta

Screenshot is generated as expected.

Taiko Commit : d473050819cdea198d9481b23bde8f9ae23283d3 

ScreenShot : screenshot-1548231839708

Apoorva-GA avatar Jan 23 '19 09:01 Apoorva-GA

@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 avatar Jan 23 '19 10:01 saikrishna321

@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 avatar Jan 24 '19 06:01 Apoorva-GA

@Apoorva-GA It works fine when running taiko script.js and breaks on REPL

saikrishna321 avatar Jan 24 '19 10:01 saikrishna321

@saikrishna321 yeah, you are right. screenshot({fullPage : true}) hangs on REPL. Will look into it.

Apoorva-GA avatar Jan 24 '19 10:01 Apoorva-GA

This is a devtools bug. Please watch issue for updates.

Apoorva-GA avatar Jan 25 '19 10:01 Apoorva-GA