我对 VBScript 或任何脚本都非常陌生。
我希望脚本检查是否加载了图像。下面是直到我被卡住的地方的脚本。
strURL="https://www.Test.com/"
strUser="******"
strPass="******"
Set oIE = WScript.CreateObject("InternetExplorer.Application","IE_")
Timeout=20 'seconds
oIE.visible=1 : BeginTimer = Timer
oIE.Navigate strURL
i=0 : bElementsLoaded=false
Set CODA_Element_1 = Nothing
Do While (oIE.ReadyState<>4 Or Not(bElementsLoaded)) And i < Timeout
WScript.Sleep(1000):i=i+1
On Error Resume Next
Set CODA_Element_1 = oIE.Document.getElementById("user")
Set CODA_Element_2 = oIE.Document.getElementById("password")
Set CODA_Element_3 = oIE.Document.getElementById("next")
If (Not(CODA_Element_1 is Nothing)) Then
bElementsLoaded=true
End If
On Error Goto 0
Loop
CODA_Element_1.value=strUser
CODA_Element_2.value=strPass
CODA_Element_3.Click()
从这里开始我不知道....我要检查的图像已加载是/codaprod/images/portal.jpg
在下面的源代码片段中
<DIV id="esisplitpanelower" class="scroller" style="height:100%; overflow:auto">
<TABLE cellpadding=0 cellspacing=0 height="100%" width="100%">
<TR><TD width="100%" height="100%"><TABLE cellpadding=0 cellspacing=0 height="100%" width="100%">
<TR><TD align="center" valign="top" width="100%" height="100%"><TABLE cellpadding=0 cellspacing=3 align="center" valign="top" height="100%" width="100%">
<TR><TD align="center" width="100%" height="100%"><TABLE cellpadding=0 cellspacing=3 align="center" height="100%" width="100%">
<TR><TD align="center"><IMG src="/codaprod/images/portal.jpg" title="Home Page">
</TD>
</TR></TABLE>
</TD>
</TR></TABLE>
</TD>
</TR></TABLE>
</TD>
</TR></TABLE>
</DIV>
有人可以告诉我如何检查此图像是否已加载吗?如果加载显示msgbox "Working!"
并且如果图像未加载则msgbox "Not Working!"