Micro Focus QTP (UFT) Forums
Page Loaded SuccessFully - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Page Loaded SuccessFully (/Thread-Page-Loaded-SuccessFully)



Page Loaded SuccessFully - learner1 - 11-17-2009

Whenever we open a Site through Tool then How Would we come to know that the page is being loaded successfuly/completely OR all the objects in the page are loaded


RE: Page Loaded SuccessFully - Saket - 11-17-2009

does this mean - you want your script to not to proceed until the page is loaded completely?
if so - you can use 'Sync' method which will wait till the page completely loaded.
Code:
Browser().Page().Sync



RE: Page Loaded SuccessFully - learner1 - 11-17-2009

Hi
I tried Sync in the below mentioned Code
Code:
systemutil.Run "C:\Program Files\Internet Explorer\IEXPLORE.EXE","MY URL"
Browser("Workspace").Page("Workspace").Sync
msgbox "Done"

Here the 'Done" message gets displayed even before the page is loaded (as i can see few of the images are still getting loaded and the Done message has apperared in front end) it means the Sync is not working in my case
Could u pls suggest me any alternatibve method


RE: Page Loaded SuccessFully - Saket - 11-18-2009

In this case, you can use
Code:
While Browser("Workspace").Page("Workspace").Object.readyState <> "complete"
    Browser("Workspace").Page("Workspace").Sync
Wend



RE: Page Loaded SuccessFully - learner1 - 11-19-2009

Hi Saket
Thanks for the example you gave and It solved my problem
But still I have a doubt that why we have used Object.readyState and not below statement
Code:
While Browser("Workspace").Page("Workspace").getroproperty("readyState  ") <> "complete"
I tried this statement but it did not work which is giving the NULL output
could you please let me know what is the difference


RE: Page Loaded SuccessFully - Saket - 11-19-2009

GetROProperty method is to retrieve the current value of an identification property. readyState is not an identification property for Page and so it wont work.
see QTP help for more information.


RE: Page Loaded SuccessFully - learner1 - 11-19-2009

Thanks saket for the information ; i got my answer from your explanation