• What is Automation Testing - Advantages & Types of Tools
  • What is Selenium IDE, Selenium RC, Selenium WebDriver, Selenium Grid?
  • Selenium IDE, Firebug & Firepath Installation


  • Selenium WebDriver Architecture
  • Selenium Installation
  • Challenges and Limitations of Selenium
  • First Selenium WebDriver Script
  • Working with Firefox Browser
  • Solution - Failed To Launch Browser Using Selenium WebDriver
  • Working with Chrome Browser
  • Working with IE Browser
  • Difference Between FindElement & FindElements
  • Install Firebug, Fire path and other add on for Selenium
  • Locators in Selenium
  • Dynamic Xpath
  • Dynamic CSS
  • Handle drop-downs
  • How to work with file upload
  • Handle Alerts & Popups
  • Handle Multiple Windows
  • Mouse Hover event in Selenium
  • Right Click
  • Double Click
  • Drag and Drop
  • Capture Screenshots in Selenium
  • Parameterization
  • Synchronization
  • Implicit Wait, Explicit Wait and Fluent Wait in Selenium
  • Implicit Waits
  • Explicit WebDriver Waits
  • Fluent Wait In Selenium
  • Apache POI
  • How To Read Data From Excel File
  • How To Write Data In Excel File
  • Database Testing Using MSSQL
  • Database Testing Using MySQL
  • Database Testing Using DB2
  • Handle Ajax Call in Selenium
  • Listeners in Selenium
  • Handling JavaScript in Selenium
  • Stale Element Reference Exception in Selenium
  • Integrate Sikuli with Selenium
  • Headless Browser Testing 
  • Headless Browser Testing using HtmlUnitDriver
  • Headless Browser Testing using PhanthomJSDriver


  • TestNG Installation
  • TestNG Complete Tutorial


  • Extent Reports Introduction
  • Extent Reports Generation
  • Capturing Screenshots & Including In Extent Reports
  • Extent Reports Version 4


  • ANT Build Tool - How To Download & Install
  • Maven Build Tool - How To Download & Install
  • Creating Maven Selenium Project
  • GIT Integration with Selenium
  • Jenkins - How To Download & Install
  • Jenkins - Executing TestNG Scripts
  • Jenkins - Generating Reports After Test Execution
  • Jenkins - Executing Maven Project
  • Create build and Execute build for nightly execution
  • Send Email report based on build Status
  • Selenium Continuous Integration with Jenkins [Selenium – Maven – Git – Jenkins] – Step By Step Guide


  • Running Selenium Tests On BrowserStack
  • Kobiton - Mobile Testing Platform with Real Devices


  • Mobile Testing Platform with Real Devices


  • What is Framework & Types of Framework
  • Page Object Model Design Pattern
  • Data Driven Framework
  • How to explain Test Automation Framework or Selenium Automation Framework Architecture In Interview

  • API Testing:

  • Learn API Testing
  • Postman Tutorial (API Testing with Postman)


  • Test Automation Framework Interview Questions
  • Selenium Interview Questions
  • TestNG Interview Questions
  • Java Interview Questions
  • Python Interview Questions
  • API Testing Interview Questions


  • Automation Tester Resume
  • How To Handle AJAX Calls Using Selenium WebDriver

    Handle Ajax Calls using Selenium:

    Handling AJAX calls is one of the common issues when using Selenium WebDriver. We wouldn’t know when the AJAX call would get completed and the page has been updated. In this post, we see how to handle AJAX calls using Selenium.

    AJAX stands for Asynchronous JavaScript and XML. AJAX allows the web page to retrieve small amounts of data from the server without reloading the entire page. AJAX sends HTTP requests from the client to server and then process the server’s response without reloading the entire page. To handle AJAX controls, wait commands may not work. It’s just because the actual page is not going to refresh.

    When you click on a submit button, required information may appear on the web page without refreshing the browser. Sometimes it may load in a second and sometimes it may take longer. We have no control on loading time. The best approach to handle this kind of situations in selenium is to use dynamic waits (i.e. WebDriverWait in combination with ExpectedCondition)

    Some of the methods which are available are as follows:

    Check this post for detailed explanation on WebDeriverWait

    In the above post, we have discussed on titleIs() condition. Let’s see some other conditions in detail.

    1. titleIs() – The expected condition waits for a page with a specific title.
    2. elementToBeClickable() – The expected condition waits for an element to be clickable i.e. it should be present/displayed/visible on the screen as well as enabled.
    3. alertIsPresent() – The expected condition waits for an alert box to appear.
    4. textToBePresentInElement() – The expected condition waits for an element having a certain string pattern.

    If you are not a regular reader of then I highly recommend you to signup for the free email newsletter using the below link.

    Handle Ajax Calls using Selenium

    Get our latest blog posts delivered to your inbox

    Subscribe and get popular blog posts about software testing industry.


    8 thoughts on “How To Handle AJAX Calls Using Selenium WebDriver”

    1. How to click on a element which is not visible on the screen?

      • Hi Saili Inamdar,
        Its not possible to click on an element which is not visible on the screen. You have to wait for the element to be loaded. Check out this post

        • Thanks Raj for your reply.

          Now in my case, the web URL, doesn’t have scroll bar so that element will not be visible unless you zoom in the page. I do not want to use zoom in zoom out functionality as it is not recommended in my project. Then in this scenario, what should i do? Please guide.

          • Hi Saili Inamdar,
            Can you please let me know
            1. Why it’s not recommended to use zoom in and zoom out.
            2. How you achieve the same behavior manually.

            • Hi Raj,

              Zoom in zoom out is not recommended as higher authorities don’t want to change zoom from 100%.
              Secondly, guys those who are doing manual testing they perform zoom in zoom out. So BA out here is not allowing to have scroll bar and so i am unable to proceed.

            • Hi Saili Inamdar,
              Selenium is a tool which automates browser. Selenium wont interact with hidden elements. But try JavaScriptExecutor. As you said even your manual testers are doing the same process. If nothing works, try to convince your team to run the script using zoom in zoom out. Also let me know the outcome of yours. Thanks.

            • Hi Raj,

              i am waiting for your comment and solution as well. Please guide me on the same.

            • Thanks Raj. I will try for JavascriptExecutor and let you know.

              I tried doing by zoom in zoom out for submenu element but it is not working in my case. Can you please guide me on this as well so that any one solution would work.

    Leave a Comment

    Share via
    Copy link
    Powered by Social Snap