If I were you, I would set up a proxy and lay all the WebDriver traffic. In the proxy for each request, I parsed the request headers and looked for the header
X-Requested-With = XMLHttpRequest
Link
If you have this, you can (with sufficient confidence) say that you called Ajax . There may be some corner cases that you miss, but this should attract you to the most.
In any case, you need to keep in mind that Ajax calls cannot be made when the page loads, it may require user interaction to start these calls.
You can try to solve this problem using the WebDrivers getPageSource() method and apply some method to the output looking for patterns like $.get( and $.post( and $.ajax( and all the others you can think of.
You may also be interested in this answer about setting up a proxy server.
source share