Playwright · Middle · Question 70 of 75
How do you make an API request with the cookies of the logged-in page?
- 1Use the
requestfixture, which reads the page cookies - 2Use
page.request, which shares the context's cookies - 3Copy cookies by hand into each
fetchcall
Show the answer
Correct answer: Use page.request, which shares the context's cookies
Explanation
page.request and context.request share storage with the browser context. The standalone request fixture has its own.