Skip to content

[Bug]: Screenshot Masking Feature Fails to Operate Properly #30752

@job221

Description

@job221

Version

1.44.0

Steps to reproduce

I am encountering an issue where the screenshot masking feature does not function correctly when taking long screenshots. Despite using the following code to mask certain elements, the specified elements are still visible in the captured screenshot.

// Wait until the page is completely loaded
await page.screenshot({
path: 'screenshot.png',
fullPage: true,
mask: [
page.locator('section').filter({ hasText: '2. Open page' }).locator('video'),
page.locator('section').filter({ hasText: 'AIMTe Video' }).locator('video')
]
});

Steps to Reproduce:

Navigate to the page where the videos are embedded.
Execute the screenshot command as provided in the code snippet.
Observe that the specified elements are not masked in the resulting screenshot.

Expected behavior

Expected Behavior:
The videos located within sections containing the texts '2. Open page' and 'AIMTe Video' should be masked out in the screenshot.

Actual behavior

Actual Behavior:
The videos are not being fully masked and appear as usual in the screenshot.

Additional context

In Playwright version 1.43.1 works perfectly

Environment

Operating System:  Windows 11 23H2 
Ryzen 7, 64 GB RAM DDR4
Intel Intel(R) N95 16GB RAM DDR4
Browser: Chrome 124.0.6367
Node: v20.10.0 / v22.1.0
Visual Studio Code 1.89.1
Playwright Extension version 1.0.22 / 1.1.0 (same result in both)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions