Relative Content

Tag Archive for playwrightplaywright-typescript

How to getProperty in Playwright

I need to get a property from the element.
How do I do that in playwright?
I can do getAttribute but I don’t see an option for getProperty?

Playwright – how to expect certain results from a response to a network request?

New to playwright and coding so bear with me. I am printing an output file from an application and need to confirm the print request is completing. Once the print button is selected, a request to startExport is executed followed by getExportStatus. I need to expect in playwright for the 2nd request’s response to contain results of completed: true and progress: 100 (because if the print request fails then the response is completed: false and progress: 0).
!(https://i.sstatic.net/lGUBpmO9.png)
!(https://i.sstatic.net/vXhUBHo7.jpg)

Playwright – route.fetch: Test ended error

In my SPA, I am using page.route() to intercept an api request. Ex: /core
The same api is getting called multiple times when I move across the pages and finally, test fails with a message route.fetch: Test ended error.
From the traces, I could understand that when the api is called first time, it is getting fulfilled, but the second time, before it gets fulfilled, test completes.