WAIT_TYPE
Definition of WAIT_TYPE
In the context of web automation scripts,, WAIT_TYPE
plays a crucial role in ensuring that web elements are in the correct state before an action is performed. Various types of waits can be specified:
VISIBILITY
Definition: The automation script waits until the web element is both present in the Document Object Model (DOM) and visible on the page.
Use Case: Use this when you need to interact with an element that must be visible to the user, such as form fields, buttons, and other interactive elements.
PRESENCE_OF_ELEMENT_ON_DOM
Definition: The automation script waits solely for the element to be present on the DOM, regardless of its visibility.
Use Case: Suitable for situations where the presence of an element within the DOM is sufficient to proceed, even if the element is not visible, such as hidden input fields.
PRESENCE_OF_TEXT_GREATER_THAN_ONE
Definition: The automation script waits solely for the element to be present on the DOM, regardless of its visibility.
Use Case: Suitable for situations where the presence of an element within the DOM is sufficient to proceed, even if the element is not visible, such as hidden input fields.
ELEMENT_TO_BE_CLICKABLE
Definition: Waits for an element to be in a state that allows user interaction, particularly to be clicked.
Use Case: Essential when ensuring that a button or link has become interactive following a prior action or page load.
PRESENCE_OF_ATTRIBUTE_VALUE_GREATER_THAN_ONE
Definition: This wait checks that an element's attribute contains a value with a length greater than one character.
Use Case: Useful when you need to validate that an attribute like 'value' in input fields is populated.
NONE
Definition: Indicates that no wait is to be applied before proceeding with the action.
Use Case: Used when the element is immediately available or when wait conditions are managed separately.
Implementation Tips
Selecting the appropriate
WAIT_TYPE
is vital for the reliability of test execution.Incorrect usage of
WAIT_TYPE
can lead to flaky tests or increased execution time.
Usage
By default default wait will be 30sec but user can provide custom timeout as per the requirement
Example:
amazonLanding,VISIBILITY:60,SCROLL_TO_TOP,condition,NONE,NONE,NONE,NONE
Demo
Last updated
Was this helpful?