Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parallel calls to Page.screenshot interfere with each other #15

Closed
aslushnikov opened this issue Jun 17, 2017 · 0 comments
Closed

Parallel calls to Page.screenshot interfere with each other #15

aslushnikov opened this issue Jun 17, 2017 · 0 comments
Labels

Comments

@aslushnikov
Copy link
Contributor

Consider the following example, which takes 10 screenshots, each of a different 50pxx50px square.

browser.newPage().then(async page => {
    await page.navigate('http://example.com');
    var promises = [];
    for (var i = 0; i < 10; ++i) {
        promises.push(page.screenshot({
            path: i + '.png',
            clip: {x: 50 * i, y: 0, width: 50, height: 50},
        });
    }
    await Promise.all(promises);
    browser.close();
});

Unfortunately, this doesn't work - calls to page.screenshot interfere with each other, failing to clip proper rect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant