If I am not mistaken, httpObj.readyState can return either a number or text value. ('complete' in your case)
Try to put a breakpoint on the Delay() line and inspect the value of the httpObj.readyState property.
P.S. BTW, it is not needed to resend the request within the while loop because:
a) you are issuing request synchronously (httpObj.open("GET", url, false); ) which means that .open() will not return until the response is received; and
b) .send() within the loop will create not necessary significant load on the web server if the response is not received within 500ms (as per your code) and request is sent asynchronously (httpObj.open("GET", url, true); ).
Regards, /Alex [Community Hero] ____ [Community Heroes] are not employed by SmartBear Software but are just volunteers who have some experience with the tools by SmartBear Software and a desire to help others. Posts made by [Community Heroes] may differ from the official policies of SmartBear Software and should be treated as the own private opinion of their authors and under no circumstances as an official answer from SmartBear Software. The [Community Hero] signature is used with permission by SmartBear Software. https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame ================================