Skip to content

[🚫 Bug] WebviewView switchToFrame gets wrong iframe #1492

Closed
@daniel-a126

Description

@daniel-a126

Describe the bug

When there are multiple Web views active in the VS Code then webview.switchToFrame() might not return the expected Web view.

This is related to the change ebc50cc released in 8.6.0 that introduces a new, less specific locator in 1.90.0.ts#L23.

The selected frame is not the same as before breaking previously working tests (Welcome walkthrough frame is not considered).

Steps to reproduce

1. Open VS Code
2. Open any sidebar with web view panel (e.g. GitLens)
2. Open Help > Welcome
3. Navigate to Get started with VS Code > Chooses your theme
4. Open dev tool (command – Developer: Toggle Developer Tools)
5. Execute old locator: $x("//div[not(@class)]/iframe[@class='webview ready' and not(@data-parent-flow-to-element-id)]");
6. Execute new locator: $x("//div[not(@data-parent-flow-to-element-id)]/iframe[@class='webview ready']");

Observe:
- Old locator returns only the the sidebar view panel's web view(s)
- New locator returns sidebar view panel's web views(s) + the Welcome page web view (at the top position)

Logs

n/a

Operating System

macOS 14.6.1

Visual Studio Code

1.92.2

vscode-extension-tester

8.6.0

NodeJS

18.19.0

npm

10.2.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    Status

    Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions