Anchor Element supports the concept of “Element Family” in accelQ. This is one of the key capabilities enabling handling of dynamic content in a web based application.
Consider a typical situation in an eCommerce application where a set of results are presented to the user; such as a list of products when you search for something. Each item presented in the screen has its attributes such as name, description, price, rating etc. represented by individual html elements. Your test logic might involve dealing with a set of such related elements. You might need to select an item from the page and gather its price and description.
Element family supports a collection of related elements to be viewed as a Family. In the above example, item name link, description, price, rating etc elements form the family. Anchor Element is any element that encompasses all the members belonging to a family.
You hover on the View and pick one of the rectangles in the View Canvas that encompasses required set of family elements. This encompassing element becomes the “Anchor” for the family.
When you develop identification criterion for a family element, you indicate the encompassing Anchor Element as its “Anchor”. This will then require a very limited set of attributes to uniquely define an element in the family. At run-time, you can point Anchor Element to one of the items on the screen and rest all elements in the Family will automatically anchor on it. Anchor Element can be pointed to required item on the screen either based on some text content, or based on index of it.