07-31-2008, 02:22 PM
Sorry i just came to this message.
here is the Function which will wait until the Browser gets loaded.
You can call after every operatins that need page to be refreshed.
Usage Ex:
here is the Function which will wait until the Browser gets loaded.
You can call after every operatins that need page to be refreshed.
Usage Ex:
Code:
Browser("Browser").Sync
' Function Sync
' -----------------------
' Supply default method that returns immediately, to be used in the Frame test object.
' Returns - True.
'@Description Waits for the test object to synchronize
'@Documentation Wait for the <Test object name> <Test object type> to synchronize before continuing the run.
Public Function Sync(obj)
wait(1) ''Updated by surya on 05/19/2008
Sync = True
If obj.Dialog("text:=.*").Exist(1) or obj.Dialog("nativeclass:=#32770").Exist(1) Then
Exit Function
End If
If obj.WinStatusBar("nativeclass:=msctls_statusbar32").GetROProperty("text") = "Done" Then
wait(1)
End If
obj.WinStatusBar("nativeclass:=msctls_statusbar32").MouseMove 1,1
sText = obj.WinStatusBar("nativeclass:=msctls_statusbar32").GetROProperty ("text") '.WaitProperty "text", "Done", 1000
If INStr(sText, "http") <> 0 Then
wait(1)
obj.WinStatusBar("nativeclass:=msctls_statusbar32").MouseMove 1,1
sText = obj.WinStatusBar("nativeclass:=msctls_statusbar32").GetROProperty ("text") '.WaitProperty "text", "Done", 1000
End If
While obj.WinObject("regexpwndclass:=msctls_progress32", "object class:=msctls_progress32","nativeclass:=msctls_progress32").Exist(1)
Wend
iWaitTime = 5000
i=1
While (InStr(sText, "Opening") <> 0 or InStr(sText, "Downloading") <> 0 or InStr(sText, "Applet Grid Started") <> 0 ) and i<iWaitTime
obj.WinStatusBar("nativeclass:=msctls_statusbar32").MouseMove 1,1
sText = obj.WinStatusBar("nativeclass:=msctls_statusbar32").GetROProperty ("text") '.WaitProperty "text", "Done", 1000
wait(1)
i=i+1
Wend
'Applet Grid Started
' obj.WinStatusBar("nativeclass:=msctls_statusbar32").WaitProperty "text", "Done", 1000
End Function
RegisterUserFunc "Browser", "Sync", "Sync"