Sobes.tech
Principal

What is the 'Grow By' method?

sobes.tech AI

Answer from AI

The 'Grow By' method in the context of test automation (usually in tools like UFT/QTP) refers to a way of identifying objects on a web page or in an application. It allows finding an object not only by its direct properties (as in regular description), but also relative to another, already found or existing object.

This is useful in cases where:

  • The properties of the target object change dynamically or are not sufficiently unique.
  • It is necessary to find an object located near another, more stable object.
  • The structure of the page/application may change slightly, but the relative position of objects remains unchanged.

'Grow By' uses the properties of a reference object (base object) and determines how to search for the target object relative to it (for example, "next div element", "parent element", "first child element").

Example pseudocode:

Browser("My Browser").Page("My Page").Link("Link 1").GrowBy("WebButton", "next")

Here, it searches for a button (WebButton) that is the "next" element after the found link (Link("Link 1")).

Browser("My Browser").Page("My Page").WebEdit("Input Field").GrowBy("Label", "preceding", "height=20", "html tag=LABEL")

This example demonstrates searching for a WebEdit element (input field) that is located after (preceding) an element of type Label with specific properties (height=20, html tag=LABEL) relative to the original WebEdit.

Using 'Grow By' increases the resilience of automated tests to minor changes in the user interface.