Hello,
i have a flaky test which fails like 2 out of 10 times with the Error:
locator.click: DOMException: Failed to execute 'querySelectorAll' on 'Document': '#randomID' is not a valid selector.
The locator exists but i don't understand why it fails.
I use await page.locator(
#${randomID}).click();
which should already auto-wait. How can i improve this test?
This thread is trying to answer question "How can I improve a flaky test that fails due to a DOMException error caused by an invalid selector?"
Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email [email protected].