I have been coming across an issue where periodically when a script should fail due to a missing element (in this case it needs to be updated), instead it just hangs indefinitely and does not time out.
Has anyone else encountered this and if so did you find a specific cause or way to resolve?
In this case, navigation to the next page fails, so the element doesn't exist and the next action can't be carried out
The action it hangs trying to carry out
await _employmentStatusComboButton.ClickAsync();
The last thing in the log:
"networkidle" event fired```
I would expect there to be some sort of timeout that would case the script to fail, but instead nothing happens until I manually abort the test.
This thread is trying to answer question "Why does a script hang indefinitely instead of failing when it can't find a required element, and how can this issue be resolved?"
Try disabling actionability checks they sometimes cause playwright executions to hang in scenarios playwright is unable to complete all the checks.
https://playwright.dev/docs/actionability#introduction
Code to disable
await page.locator('#abc').click({ force: true });
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].