NetNodeMan
Technical User
Hello folks,
I have the following VB code and as those of you in the know can see wht it does is that it goes to a specific web page. Within this webpage there are two text boxes. It enters data in the two text boxes and clicks on "Continue". A page appears in internet explorer telling me I'm a good boy (or words to that effect)
Now I'm completely useless at this so bear with me. I want to add code to this script so that if I get a "This page cannot be displayed message" i.e. the process doesn't work, I get a popup and a sound played.
Ideally I would like to call a batch file for this i.e. send an email when it doesn't work.
I would like help with both possibilities please and please remember I'm new so be gentle.
Thanks in advance
I have the following VB code and as those of you in the know can see wht it does is that it goes to a specific web page. Within this webpage there are two text boxes. It enters data in the two text boxes and clicks on "Continue". A page appears in internet explorer telling me I'm a good boy (or words to that effect)
Now I'm completely useless at this so bear with me. I want to add code to this script so that if I get a "This page cannot be displayed message" i.e. the process doesn't work, I get a popup and a sound played.
Ideally I would like to call a batch file for this i.e. send an email when it doesn't work.
I would like help with both possibilities please and please remember I'm new so be gentle.
Thanks in advance
Option explicit
Dim IE, sLoop, sLoop2, isOperationComplete, dState, sList, sError
Sub objIE_NavigateError(pDisp,URL,TargetFrameName,StatusCode,Cancel)
wscript.echo now() & " Error " & StatusCode & " accessing " & URL
End Sub
Sub objIE_NavigateComplete2(pDisp,URL)
isOperationComplete = true
End Sub
Function Wait()
sError = 1
Do while IE.busy
wscript.sleep 1000
sError = sError + 1
Loop
if sError > 20 then
exit Function
end if
dState = IE.document.readystate
while (dState <> "complete" and sError < 20)
Wscript.sleep 1000
dState = IE.document.readystate
sError = sError + 1
wend
End Function
sLoop = "forever"
dState = ""
Do while sLoop = "forever"
sLoop2 = "forever"
Do while sLoop2 = "forever"
'Commented out by Finner.
'************ HTTP Check
'set IE=Wscript.CreateObject("InternetExplorer.Application","objIE_")
'IE.navigate("WEB PAGE ADDRESS GOES IN HERE")
'IE.visible = True
'wait()
'if sError > 20 then
' wscript.echo now() & " Http Error is there an error code for this date and time ?"
' ie.quit
' exit do
'end if
'IE.quit
'************ End of HTTP check
'///Finner - no need for this I think
'************ HTTPS Check
set IE=Wscript.CreateObject("InternetExplorer.Application","objIE_")
IE.Navigate("")
IE.visible = True
wait()
if sError > 20 then
wscript.echo now() & " Https Page 1 Error is there an error code for this date and time ?"
ie.quit
exit do
end if '/////no need for this I think
IE.document.getElementByID("VRM").value = "LD02YXZ" 'this is the VRM field
IE.document.getElementByID("TestNumber").value = "152008305118" 'this is the Test Number field
IE.document.getElementByID("cmdSubmit").click
wait()
if sError > 20 then
wscript.echo now() & " Https Page 2 Error is there an error code for this date and time ?"
ie.quit
exit do
end if
IE.quit
sLoop2 = "done"
Loop
'Wait for 5 Minutes
Wscript.Sleep 30000