Skip to content

tab-select command causes snapshot to display incorrect Page URL/Page Title #310

@NINTING

Description

@NINTING

Bug Description

After using tab-select to switch tabs, the snapshot command outputs incorrect Page URL and Page Title information.

Steps to Reproduce

  1. Open browser with multiple tabs (e.g., click a link that opens in new tab)
  2. List tabs and switch to a different tab:
playwright-cli tab-list
# Output: 0: [Page1], 1: [Page2]

playwright-cli tab-select 1
# Output shows tab 1 as (current)
  1. Take snapshot:
playwright-cli snapshot

Expected Behavior

The snapshot command should display the correct Page URL and Page Title of the newly selected tab (tab 1).

Actual Behavior

### Page
- Page URL: https://page1-url.com (WRONG - shows old tab URL)
- Page Title: Page 1 Title (WRONG - shows old tab title)

However, when reading the generated .yml snapshot file, it contains the correct page elements from the new tab (tab 1).

Root Cause Analysis

  • tab-select does correctly switch the active page - actual operations (click, fill) work on the new tab
  • tab-list correctly shows the switched tab as current
  • Only the metadata output (Page URL/Title) in the snapshot command is stale/wrong

Workaround

To verify actual page content after tab-select, must read the generated .yml file instead of trusting the snapshot command output.

Environment

  • playwright-cli version: latest
  • OS: Windows

Impact

This is confusing for users and makes debugging difficult when working with multiple tabs.

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