Open fabianboth opened 3 weeks ago
Can reproduce, but unsure if this is correct. @dgozman could you take a look?
@fabianboth This is because the whole date-picker table is inside a <div role=button>
that opens it. Playwright assumes that when you'd like to click on an element inside a button, you'd actually like to click on the button.
I think the web site is doing something strange, but Playwright is also limiting the ability to generate a recording. I am not yet sure what would be the best solution. Maybe generating multiple locators could help.
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