Micro Focus QTP (UFT) Forums

Full Version: Progress Bar of Internet Explorer
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

Does anyone know if there's a way to work with the progress bar of IE??

I want to wait till it has been completed so that I can proceed.
Hi,
Instead you can use page's status property is complete or not. Need to google for exact property name used in QTP Wink
You can spy on the status bar of your IE, it should be showing something like Browser("xyz")>Winstatusbar("abc") in spy tree and on highlighting on winstatusbar, you will be seeing properties for it. I observed 'regexpwndtitle' prop is having value 'done'. Try with GetROProperty("regexpwndtitle") = "done".
Hello there!

Use ReadyState Property.


I hope this helps.
Use ReadyState Property.

Thank you so Much,
UFTEnthusiast
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:

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
Hi tdevick,

I do agree with you but the only with is the issue with QTP sync is commonly noticed. In order to handle this situation, I always use my own function rather than depending on the QTP method.
here is the loc:
Code:
Browser("TestBrowser").Refresh
StartTime = Now()
'Used DateDiff  method as Timeout.
Do until  Browser("TestBrowser").Object.ReadyState = 4 or DateDiff("s",Now(),StartTime)>20
    wait 1
Loop
If Browser("TestBrowser").Object.ReadyState = 4 Then
    msgbox "Done"
    Else
    msgbox "Browser was not loaded with in 20 seconds."
End If

Let me know if you need any info or if it doesn't work.