0

When we are testing our client application with selenium on IE11, selenium clicks a button in order to perform login,the click triggers JQuery Post request and sometimes having immediate response with status = 0 and statusText:null. When this problem happens, the request does not sent to the server. The request is quite trivial:

 $.ajax({
            type: "POST",
            url: url + "api/Login",
            headers: { "Authorization": "Basic " + enc },
            xhrFields: {
                withCredentials: true
            },
            crossDomain: true,
            dataType: "json",
            contentType: "application/json",
            data: JSON.stringify({ ApplicationType: config.applicationTypeLogin })
        })

I can see that when this happens for the very same request, the IIS server never receives the request and the HTTP status is never set and has a value of zero. That means the request blocked within the browser, there is no real response from the server because the request is never made.

Does anyone have ideas on how to troubleshoot this issue?

1 Answers1

0

Useful Links:

https://forum.jquery.com/topic/ajax-error-status-0-for-some-but-not-all-browsers

jQuery Ajax - Status Code 0?

Some reasons for this could be:

  1. No internet connectivity
  2. Domain is unreachable DNS issues
  3. Request is intercepted (check your ad blocker)
  4. An AJAX call is initiated but browser refresh was triggered before getting the AJAX response

Since this is an intermittent issue, try reproducing it manually

Mohsin Mehmood
  • 4,156
  • 2
  • 12
  • 18