Skip to content

[BUG] Locator.count() with _vue selector #12623

@yuvalkarif

Description

@yuvalkarif

Context:

  • Playwright Version: 1.19.0
  • Operating System: Windows 10
  • Node.js version: 16.13.0
  • Browser: Chromium
  • Site is using Nuxt 2 SSR

Code Snippet

// Doesn't work correctrly
const colorSelectorVue = await this.page.locator('_vue=NbwColorSelector >> visible=true')
const colorSelectorVueCount = await colorSelectorVue.count()

// output: colorSelectorVueCount=0

// Works as intended (class and _vue point to the same dom element)
const colorSelector = await this.page.locator('.color-selector')
const colorSelectorCount = await colorSelector.count()

// output: colorSelectorCount=3

image

Describe the bug

As you can see the count() method on the locator doesn't work on locators that use the _vue selector, the interesting part is that the locator indeed locates the right element in the debugging tools. also using a class locator counts the elements fine.
Elements are not hidden (as they may appear in the screenshot) and fully working. Also I'm pretty sure this used to work in an earlier version but I cannot confirm for sure.

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