Forum Discussion
AlexKaras
12 years agoCommunity Hero
Hi Ted,
I think that the problem is caused by the fact that VBScript does not support short-circuit evaluation of the logical expressions and always evaluates all conditions even if it is not necessary.
So it is possible that frame.contentDocument may exist but its readyState property is not accessible yet.
I would suggest to modify your code like this:
instead of:
If frame.Exists And frame.contentDocument.readyState <> "complete" Then
waitFrame = true
Exit For
End If
try this (not tested):
If frame.Exists
Do While Not aqObject.IsSupported(frame.ContentDocument, "readyState")
aqUtils.Delay(100)
Loop
Do While "complete" <> frame.ContentDocument.readyState
aqUtils.Delay(100)
Loop
waitFrame = true
Exit For
End If
I think that the problem is caused by the fact that VBScript does not support short-circuit evaluation of the logical expressions and always evaluates all conditions even if it is not necessary.
So it is possible that frame.contentDocument may exist but its readyState property is not accessible yet.
I would suggest to modify your code like this:
instead of:
If frame.Exists And frame.contentDocument.readyState <> "complete" Then
waitFrame = true
Exit For
End If
try this (not tested):
If frame.Exists
Do While Not aqObject.IsSupported(frame.ContentDocument, "readyState")
aqUtils.Delay(100)
Loop
Do While "complete" <> frame.ContentDocument.readyState
aqUtils.Delay(100)
Loop
waitFrame = true
Exit For
End If