Synchronization in UFT is a generic way to have specified amount of time for an object to process prior to moving to next step. “ReadyState” is one of the best possible way to synchronize, generally used to wait till the full loading of DOM tree and used as like
Browser().Object.readyState
Ready State Property
Every XML and HTML document in any HTML/web application is called as Document. Every time the document gets loaded/removed based on the navigation/action is performed by the user. Each document has a current document readiness which is set depending on the current document readiness status. The same applies for the objects in the document as well.
‘readystate’ property of the document retrieves the value, that indicates the current state of the document readiness.
object.readystate
when you set a url to load a particular page, the value will be set as ‘loading’ if the page is associated with a parser like HTML or XML parser. Once the parsing is done and page is loaded, the value will be set as ‘complete’.
The possible values of readystate are-
‘complete‘ when the object is completely initialized.
An object’s state is initially set to uninitialized, and then to loading. When data loading is complete, the state of the link object passes through the loaded and interactive states to reach the complete state.
This property can be used to synchronize the test steps better, which involves loading/navigation of pages. This will give you the exact sync between the two steps. for example if you want to wait till the page loads completely.
Do while ((Browser().Page().Object.ReadyState<>"complete" wait(1) Loop
Stumbled into this website by chance but I’m sure glad I clicked on that link. You positively answered all the questions I have been dying to answer for some time now. Will definitely come back for more of this. Thank you so much
wow its great post..
nice and thanks.
Simply want to say your article is as surprising. The clarity on your put up is just spectacular and i could think you’re an expert on this subject.
Hi Saket,
This is my Script for password but its through general error.
Browser(“micclass:=Browser”).Page(“micclass:=Page”).Link(“Index:=3”).set “India”
if i use this code its executing, why Micclass:=Browser is not supporting on my application.
Browser(“name:=Home).Page(“title:=Home”).Link(“Index:=3”).set “India”
Do you have multiple browsers open at the time you are executing? It might be because of that. micclass=Browser represents any open browser and if multiple browser are open. it wont work. Always use creation time property for Browser, which is most reliable.
thanks for the reply, i found this solution. its due to browser compatibility.
Hi Saket,
I used to prepare script through IE but I tried to prepare script through Chrome but object is not visible, is it chrome will support UFT?
QTP11 also supports Chrome. refer the link below for the required patch.
http://support.openview.hp.com/selfsolve/document/KM1276297
Hi saket,
I am trying to prepare script using Mozilla v10 and UFT 11.5 but my tool is not identifying the object. As per forum UFT 11.5 supports Mozilla v10 & v11, but in my case its not supporting.
Please give your valuable suggestion/feedback & kindly assist
Hi Saket,
I found the solution for Mozilla now working fine but chrome V34 is not working. Even installed Patch file and enable extension.
Kindly assist.
hi Saket
in the above example could you please explain( <> ) what are these two in the object description
thanks for the post ,
It was just an html issue. I have made the fix now.