title: Playwright Wait for Page to completely load and XHR / Ajax Calls complete
body: <p>I have previously used Puppeteer in Node.js and I am now using Microsoft.Playwright in .Net</p>
  <p>I have a need to wait until all XHR / Ajax requests have finished so that the page is in a truly &quot;ready&quot; state.  Using timouts and delays is unreliable.</p>
  <p>With Puppeteer I used a library Pending XHR Puppeteer <a href="https://www.npmjs.com/package/pending-xhr-puppeteer" rel="nofollow noreferrer">https://www.npmjs.com/package/pending-xhr-puppeteer</a> which was designed for this issue specifically</p>
  <p>So in node.js I would load the page etc inside a warapper and then when needed I would just call</p>
  <pre><code>await pageWrapper.waitForAllXhrFinished()
  </code></pre>
  <p>I am assuming that behind the scenes it is keeping count of the ajax requests sent and returning the function once they have all returned.</p>
  <p>Note:  for one of my scenarios there are 2 XHR requests set and they are from exactly the same URL.</p>
  <p>How can we achieve this in Playwright for .Net ?</p>