Monday, 27 April 2020

SE - 77 - What are AJAX calls and how to handle it in Selenium

AJAX - Asynchronous Java-Script And XML

It is a way to Asynchronously send/receive data from a web page to server without actually re-loading the whole page. From a user perspective there is no visible change in the webpage as the request/response is done automatically without refreshing the webpage.
There may be issue in locating such elements as it may take some time to load.  So it needs to be handled as normal execution of script will fail if the AJAX calls are in process.

To handle this situation we have multiple options in Selenium :

1) Thread.Sleep
2) Explicit Wait
3) Implicit Wait
4) Fluent wait
5) Selenium based waits


No comments:

Post a Comment