05-12-2011, 10:14 PM
Rajendraprasad,
How does waiting for "Browser(<browser-name>").object.ReadyState = 4" differ from just calling "Browser(<browser-name>).Sync"?
I have always used Browser(<browser-name>).Sync. That works under most conditions. Sometimes it does not wait until the browser has finished drawing the page (maybe due to javascript or other dynamic data).
I have tried both ways with problem pages and saw no difference. I suspect that Browser.Sync may be nothing more than waiting on ReadyState = 4.
How do you wait for ReadyState = 4? without looping every x seconds until some y seconds has passed? QTP help or WaitProperty says, "you can instruct QuickTest to wait for a particular string to appear in a static text control". But, ReadyState is not a "static text control".
I did find an example that sounds like what you're talking about under help for WaitProperty:
When I execute the above code against my link, which is completely drawn and ready, I always get a returnStatus of FALSE.
I also tried replacing "complete" with "4", but get the same result.
Can you explain further please, Rajendraprasad?
Tim
How does waiting for "Browser(<browser-name>").object.ReadyState = 4" differ from just calling "Browser(<browser-name>).Sync"?
I have always used Browser(<browser-name>).Sync. That works under most conditions. Sometimes it does not wait until the browser has finished drawing the page (maybe due to javascript or other dynamic data).
I have tried both ways with problem pages and saw no difference. I suspect that Browser.Sync may be nothing more than waiting on ReadyState = 4.
How do you wait for ReadyState = 4? without looping every x seconds until some y seconds has passed? QTP help or WaitProperty says, "you can instruct QuickTest to wait for a particular string to appear in a static text control". But, ReadyState is not a "static text control".
I did find an example that sounds like what you're talking about under help for WaitProperty:
Code:
returnStatus=Browser("mybrowser").Page("mypage").Link("mylink").WaitProperty("attribute/readyState", "complete", 5000)
When I execute the above code against my link, which is completely drawn and ready, I always get a returnStatus of FALSE.
I also tried replacing "complete" with "4", but get the same result.
Can you explain further please, Rajendraprasad?
Tim