Documentation

Looking for something in particular?

Block Locator Strategies

Block Locator Strategies help you train Provar to recognize a specific block or grouping of elements on a page such as a pop-up dialog box, tab, or page section.

Introduction

A Block Locator Strategy helps Provar locate elements accurately on pages where multiple fields of the same name may exist. This helps Provar limit its search to a specific area when locating the field.

A Block Locator Strategy is particularly useful for custom pages, which Provar may not recognize automatically, or third-party applications on any platform. Once a Block Locator Strategy is defined, it can be reused across multiple similar pages to simplify your element locators.

The benefits of Block Locator Strategies 

  • Activating tabs to reveal different panels of information
  • Expanding or collapsing page sections
  • Locating the right field when similar fields are present in different blocks. For example, the same field label might be present in a pop-up dialog and on the screen behind the dialog.

Note that while By Label Strategies locate fields and appear in the Field Details section in Test Builder, Block Locator Strategies pertain to the Page Structure section. A new Page Structure entry is typically created for each matched block.

Creating a block locator strategy

Block Locator Strategies are written in Java rather than declaratively through Provar. They can be written from scratch, or the Provar Support team can help to provide a Block Locator Strategy file for your use case.

Once a Block Locator Strategy is created, the .java file should be stored under pagestrategies below the src folder. This can be seen in the Navigator below:


Feedback

Was this article helpful for you?
Documentation library

Trying to raise a case with our support team?

We use cookies to better understand how our website is used so we can tailor content for you. For more information about the different cookies we use please take a look at our Privacy Policy.

Scroll to Top