Skip to content

screenshot mask locators only masking first found item #1585

@theoephraim

Description

@theoephraim

Environment Information

Stagehand:

  • Language/SDK: TypeScript
  • Stagehand version: 3.0.7

Issue Description

It seem that when using the mask option on page.screenshot, that only the first matching element is masked.

If this is intended behaviour, it certainly was not expected. There does not seem to be any way to explicitly opt into masking all matching elements.

Steps to Reproduce

  1. use page.screenshot with an overly broad locator (e.g., mask: page.locator('input'))
  2. call page.screenshot on a page with multiple matching elements
  3. save the screenshot to a file to observe
  4. note that only the first input is masked

Minimal Reproduction Code

I will try to set up a minimal repro and edit this soon.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions