Skip to content

[BUG] The Locator count() function fails with a TypeError #11254

@smeierhofer

Description

@smeierhofer

Context:

  • Playwright Version: 1.17.1
  • Operating System: Windows
  • Node.js version: v14.18.1
  • Browser: Chromium
  • Extra: None

System:

  • OS: Windows 10 10.0.19042
  • Memory: 8.06 GB / 31.73 GB

Binaries:

  • Node: 14.18.1 - C:\nodejs\node.EXE
  • Yarn: 1.22.10 - ~\AppData\Roaming\npm\yarn.CMD
  • npm: 6.14.11 - C:\nodejs\npm.CMD

Languages:

  • Bash: 5.0.17 - C:\WINDOWS\system32\bash.EXE

Code Snippet

const count = await this.page.locator('#searchResultTableDiv .x-grid3-row').count();

The Locator count function fails. I see the following in the Playwright debugger:

locator.count
(#searchResultTableDiv .x-grid3-row)
— 4ms
TypeError: r.set is not a function
    at b._querySelectorRecursively (<anonymous>:3:50248)
    at b.querySelectorAll (<anonymous>:3:50693)
    at eval (eval at evaluate (:3:2389), <anonymous>:5:23)
    at t.default.evaluate (<anonymous>:3:2412)
    at t.default.<anonymous> (<anonymous>:1:44)

Metadata

Metadata

Assignees

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