Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Sync points
#1
Solved: 11 Years, 3 Months, 4 Weeks ago
Hi,

I'm trying to use sync points in my tests but i've put the sync in a function and tried to make it as generic as possible to be able to use it in different tests on different pages. My function looks like this:

Code:
Function SyncBrowser
    
    Browser(".*").WinStatusBar("msctls_statusbar32").WaitProperty "text", Done, 10000

End Function

It is supposed to wait untill the status bar in the browser says "Done"

when I run the test it keeps complaining that the object is not in the repository even though i've added the object to the repository for each of the browser pages that i will be running my tests against.

I have also tried
Code:
Browser("title:=.*").Page("title:=.*").Sync

and
Code:
Browser("title:=.*").Sync

In tests where possible I have used .Exist(10) but this is not always possible

I would be greatful for any ideas or suggestions.
Reply
#2
Solved: 11 Years, 3 Months, 4 Weeks ago
Replace the code in your function with below
Code:
'Assumption you will have only one browser
Do until Browser("CreationTime:=0").Object.StatusText = "Done"
     msgbox Browser("CreationTime:=0").Object.StatusText
    wait 1
Loop
Thanks,
SUpputuri
Reply
#3
Solved: 11 Years, 3 Months, 4 Weeks ago
You can use this code to avoid the script getting in the infinite loop in case the page is not displayed.
Code:
Function Page_exist
   intcount=0
Do     
    strStatus =Browser("title : = ").Object.StatusText
    intcount = intcount +1
    If intcount = 100 Then
        Exit Function
    End If
    If instr(strStatus ,"Done")> 0 Then
        Exit function
    End If
    wait 1
Loop While instr(strStatus,"Done") < 1
End Function
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  picking different points in UFT using VB Script azjk786 0 1,061 12-14-2020, 09:57 AM
Last Post: azjk786
Question Cross Browser Sync Not Working geodude 0 1,968 04-07-2017, 08:43 AM
Last Post: geodude
  How to use sync function 22sumit 2 3,480 06-16-2015, 06:27 PM
Last Post: 22sumit
Wink Webedit Javascript sync issue praveenzack 3 3,280 10-10-2012, 06:25 PM
Last Post: praveenzack
  .Sync is NOT waiting for browser to complete current navigation.. can anyone help? mansis 4 4,606 09-14-2012, 06:53 PM
Last Post: mansis

Forum Jump:


Users browsing this thread: 2 Guest(s)