0 Shares 5038 Views 13 Comments

Synchronizing with readystate

Oct 22, 2012
5038 Views 13
Synchronization

SynchronizationSynchronization 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

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.

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-

uninitialized‘ if the Object is not initialized with data.
loading‘ when object is loading its data.
loaded‘ if the object has finished loading its data.
interactive‘ if the User can interact with the object even though it is not fully loaded.

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.

 

You may be interested

UFT Patch Updates – UFT 14.03
Unified Functional Testing
960 views1
Unified Functional Testing
960 views1

UFT Patch Updates – UFT 14.03

Saket - Mar 11, 2018

Post the launch of UFT 14.0, there are three patch updates has been released including a number of features and enhancement. Recently Micro Focus unveiled third patch…

Setting up Web Service Automation Project
Katalon Studio
1124 views
Katalon Studio
1124 views

Setting up Web Service Automation Project

Saket - Oct 24, 2017

Web services are specific services that can be published and called over the Internet by client applications. Katalon Studio supports functional testing of web services. This topic…

Setting up Mobile Automation Project in MacOS
Katalon Studio
996 views1
Katalon Studio
996 views1

Setting up Mobile Automation Project in MacOS

Saket - Oct 09, 2017

Using Katalon Studio, mobile tester can design automation test for both Android and iOS to run on physical devices, cloud services and emulators. This tutorial explains how…

13 Comments

  1. 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

    Reply
  2. 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.

    Reply
  3. 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”

    Reply
    • 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.

      Reply
  4. 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?

    Reply
  5. 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

    Reply
  6. 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.

    Reply
  7. hi Saket
    in the above example could you please explain( <&gt ) what are these two in the object description

    thanks for the post ,

    Reply

Leave a Comment

Your email address will not be published.

Most from this category

Join The Growing Group of 15000+ Test Automation Engineers

Signup for our newsletter and get access to free downloads, as well as tips, tricks and techniques and various test automation resources.
Name
Email Address
Secure and Spam free...