Forum Discussion

meenakshiyadav1's avatar
meenakshiyadav1
Contributor
6 years ago

Not able to synchronize object on screen with testcomplete

I am working on a flex based web application which takes time to load so I am using static delay which increases execution time significantly. I want to write a function to sync TestComplete with the object expected to be on screen.
I have written below code where I am passing the object that needs to be sync as a parameter but it is not working. I am new to Javascript so might be making some mistakes. can anyone please help.

 

 

function sync(syncobj)
{
var i=0
while (syncobj==NULL)

{
If (i > 60)
{
Log.Message("Object = " +syncobj + " not found")
}
aqutils.Delay(1000)
Log.Message("Syncing object")
i = i++
}
return syncobj
}

 

I am calling this sync function before the statement in which the object is getting used. While debugging I am getting error "Object expected" at If condition statement.

8 Replies

  • baxatob's avatar
    baxatob
    Community Hero

    Hi,

     

    First of all, what kind of object you are passing to the function? Please show, how you do it.

     

    Anyway, if the object was not found at the moment of calling function, it would be a STUB object (not NULL). And this object will not changed within your function.