Hey guys Maybe someone have encountered the same problem. When I'm trying to click on toggle and wait to particular response nothing happens, request is not being sent for some reason. It works in 20% of the runs and actually never passes in a first attempt. What could be an issue? headless or not doesn't matter, result is the same
This thread is trying to answer question "What could be the issue causing the request to not be sent after a click action, and how can it be resolved?"
Many apps/pages appear ready when they're not. So Playwright's actionability checks will pass, Playwright will click or enter a field, but the event handlers aren't attached yet, so nothing happens, or even worse, the field value will be overwritten by the app/page initialization.
Something like that should ideally be fixed in the app (show glass pane when loading/processing or disable controls, etc.), but if that's not option we have to add an intelligent wait in the test for some indicator of the page being ready. Like a waitForResponse or waiting for a logout link appearing. What you need to wait for depends on the app and the scenario.
(This would be worth a FAQ article)
Hmm could still be that the page is not ready to proceed.
Have you tried the trace viewer? https://playwright.dev/docs/trace-viewer-intro
I always set the trace option to 'retain-on-failure' because whenever the tests fail, it's much easier to troubleshoot.
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].