playwright
playwright copied to clipboard
[Bug]: Playwright locator from generateLocator refers to the wrong html element
Version
1.47.2
Steps to reproduce
On https://www.redbus.in/, click the calendar dropdown.
Then try to generate a locator with playwright.generateLocator for any of the date fields.
Expected behavior
Getting a playwright locator, that could click the respective date field when using locator.click(). Similar to clicking with the mouse on the date entry, this should select the correct date in the date picker.
Actual behavior
The locator refers to a button which opened the calendar drop-down. All dates refer to this button, and clicking does not select a date.
Additional context
This is the mentioned calendar dropdown:
If e.g. 10th of Oct is selected as element, the playwright locator resolves to the button element instead
The element where the locator points to
Environment
System:
OS: Linux 6.8 Ubuntu 22.04.5 LTS 22.04.5 LTS (Jammy Jellyfish)
CPU: (16) x64 11th Gen Intel(R) Core(TM) i9-11950H @ 2.60GHz
Memory: 15.38 GB / 31.05 GB
Container: Yes
Binaries:
Node: 20.15.1 - ~/.nvm/versions/node/v20.15.1/bin/node
npm: 10.7.0 - ~/.nvm/versions/node/v20.15.1/bin/npm
pnpm: 9.11.0 - ~/.nvm/versions/node/v20.15.1/bin/pnpm
Languages:
Bash: 5.1.16 - /usr/bin/bash
npmPackages:
@playwright/test: 1.47.2 => 1.47.2
playwright-core: 1.47.2 => 1.47.2