QTP - Wait for web page to load completely



 There are instances when there isn't any unique property or object to check on the landing page during a browser navigation, in such cases we can use either of the below options to code:

set objReadyState = Browser("").Page("").Object
While objReadyState.readyState = "Completed"
Wend
Set Object=nothing


Set Object=Browser("").object
While Object.Busy=True
Wend
Set Object=nothing

Happy Testing!

Comments

  1. Anonymous29/8/12

    Dear Aditya Kalra,

    Thanks a lottttttttttttttttt, really awesome, its working perfect

    for this code i searched from past 1 1/2 year, finally i got it

    really thank you v v very much.

    Regards,
    G@vey0m

    ReplyDelete
  2. Thanks , Glad that helped!

    Best Regards,
    Ady.
    " Besides black art, there is only automation "
    Technology Specific Guide For QTP - My new Book on QTP

    ReplyDelete
  3. Anonymous28/6/13

    Since the admin of this website is working, no doubt very shortly it will be well-known, due to its quality contents.


    Here is my site; New Kobe Bryant Shoes

    ReplyDelete
  4. Is it worth adding extra condition to exit while?

    For example
    IF WaitTime > "27min" THEN exit while

    ReplyDelete
  5. Hey Sergiusz,
    In case you think that the application isn't stable, that's exactly what you should do to break out of the infinite loop. We generally add a statement that would do this for us especially if we are expecting to run a complete test suite.
    Best Regards,
    Ady

    ReplyDelete

Post a Comment

Popular posts from this blog

Software Testing @ Microsoft

Trim / Remove spaces in Xpath?