I have web application with a lot of objects.
I should check with QTP How long time some object load.
How can I check if some object load to the application.
The time I can check with timer but when to stop the timer I don't know.
How can I check the appliction finish to load the objects?
Well, I can see 2 approaches:
1. Ask developers to add small client-side JScript to measure the time for object(s) to load, render, etc. They can add it to the page as invisible objects you still can "catch" with QTP.
2. For a single object you can write some simple function, like this one:
<font class="small">Code:</font><hr /><pre>
public function wait4obj (myobj)
while obj_not_exist(myobj) and a<40
if a=40 then
wait4obj=-1 ' Object not loaded withing timeout
The function shall return -1 if the object does not appear within some timeout (40 sec in this case), or time in seconds it took for the object to appear.
"obj_not_exist" is a function that returns False if object already exist, and True otherwise. You can use simply "myobj.exist" to check for object but I found that it is not very reliable, so I use myobj.waitproperty ("visible", true, 1) to check if object is already present. I think you can use another property if object is not visible by default.