This thread is trying to answer question ""
You can also use CDP to get your performance timings: https://anandhik.medium.com/performance-testing-in-playwright-64cdef431e2e
I was thinking about using web performance APIs alongside Playwright, and my plan looked something like this. But it turns out that the navigation API I had in mind is no longer supported. I tried searching for an alternative but came up empty-handed; there doesn't seem to be any documentation on it.
const time = performance.timing;
return time.loadEventStart - time.navigationStart;
});```
await page.goto('https://danube-webshop.herokuapp.com')
const performanceTimingJson = await page.evaluate(() => JSON.stringify(window.performance.timing))
const performanceTiming = JSON.parse(performanceTimingJson)
console.log(performanceTiming)
const startToInteractive = performanceTiming.domInteractive - performanceTiming.navigationStart
console.log(`Navigation start to DOM interactive: ${startToInteractive}ms`)
Yep, I've got this page, and the navigationStart is the part that's no longer supported
https://developer.mozilla.org/en-US/docs/Web/API/PerformanceTiming/navigationStart
It suggests to use https://developer.mozilla.org/en-US/docs/Web/API/PerformanceNavigationTiming
This might be helpful https://anandhik.medium.com/performance-testing-in-playwright-64cdef431e2e Thank you @tphillips8117
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].