Created
November 8, 2016 12:06
-
-
Save ArtemAvramenko/6936595d7d7003e20a27ddd161e839e9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// cscript waitUrl.js http://alm-build/TimeTracker/dev/test/favicon.ico | |
var url = WScript.Arguments(0); | |
var status = 0; | |
var WinHttpReq = new ActiveXObject('WinHttp.WinHttpRequest.5.1'); | |
for (var i = 0; i < 30; i++) { | |
WScript.Sleep(1000); | |
WinHttpReq.Open('GET', url, false); | |
WinHttpReq.Send(); | |
status = WinHttpReq.Status; | |
if (status == 200) { | |
break; | |
} | |
} | |
WScript.Echo('Status: ' + status); | |
if (status != 200) { | |
WScript.Quit(10); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment