Skip to content

Screenshot command fails with 'selector: Expected string, received null' #238

@Arrthurr

Description

@Arrthurr

Description

The screenshot command fails with a validation error when trying to capture a screenshot of a page.

Steps to Reproduce

agent-browser open https://example.com
agent-browser screenshot

Or with a file path:

agent-browser open https://example.com
agent-browser screenshot ./screenshot.png

Or with --full flag:

agent-browser open https://example.com
agent-browser screenshot --full ./screenshot.png

Expected Behavior

Screenshot should be captured and either output to stdout (base64) or saved to the specified file.

Actual Behavior

✗ Validation error: selector: Expected string, received null

Environment

  • agent-browser version: 0.7.5
  • OS: macOS (Darwin 24.6.0)
  • Node version: $(node --version)

Notes

  • Other commands work fine (open, snapshot, get title, get url, eval, hover, close)
  • The page loads correctly and can be interacted with
  • Only the screenshot command fails

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