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. Block locator strategies are available from Provar version 1.9.8 onwards.
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:
- Provar Automation
- Installing Provar Automation
- Updating Provar Automation
- Using Provar Automation
- API Testing
- Behavior-Driven Development
- Creating and Importing Projects
- Creating Test Cases
- Custom Table Mapping
- Functions
- Debugging Tests
- Defining a Namespace Prefix on a Connection
- Defining Proxy Settings
- Environment Management
- Exporting Test Cases into a PDF
- Exporting Test Projects
- Override Auto-Retry for Test Step
- Managing Test Steps
- Namespace Org Testing
- NitroX
- Provar Desktop
- Provar Test Builder
- Refresh and Recompile
- Reintroduction of CLI License Check
- Reload Org Cache
- Reporting
- Running Tests
- Searching Provar with Find Usages
- Secrets Management and Encryption
- Setup and Teardown Test Cases
- Tags and Service Level Agreements (SLAs)
- Test Cycles
- Test Plans
- Testing Browser Options
- Tooltip Testing
- Using the Test Palette
- Using Custom APIs
- Callable Tests
- Data-Driven Testing
- Page Objects
- Block Locator Strategies
- Introduction to XPaths
- Creating an XPath
- JavaScript Locator Support
- Label Locator Strategies
- Maintaining Page Objects
- Mapping Non-Salesforce fields
- Page Object Operations
- ProvarX™
- Refresh and Reselect Field Locators in Test Builder
- Using Java Method Annotations for Custom Objects
- Applications Testing
- Provar Manager
- DevOps
- Introduction to Test Scheduling
- Apache Ant
- Configuration for Sending Emails via the Automation Command Line Interface
- Continuous Integration
- AutoRABIT Salesforce DevOps in Provar Test
- Azure DevOps
- Running a Provar CI Task in Azure DevOps Pipelines
- Configuring the Automation secrets password in Microsoft Azure Pipelines
- Parallel Execution in Microsoft Azure Pipelines using Multiple build.xml Files
- Parallel Execution in Microsoft Azure Pipelines using Targets
- Parallel execution in Microsoft Azure Pipelines using Test Plans
- Bitbucket Pipelines
- CircleCI
- Copado
- Docker
- Flosum
- Gearset DevOps CI/CD
- GitHub Actions
- Integrating GitHub Actions CI to Run Automation CI Task
- Remote Trigger in GitHub Actions
- Parameterization using Environment Variables in GitHub Actions
- Parallel Execution in GitHub Actions using Multiple build.xml Files
- Parallel Execution in GitHub Actions using Targets
- Parallel Execution in GitHub Actions using Test Plan
- Parallel Execution in GitHub Actions using Job Matrix
- GitLab Continuous Integration
- Travis CI
- Jenkins
- Execution Environment Security Configuration
- Provar Jenkins Plugin
- Parallel Execution
- Running Provar on Linux
- Reporting
- Salesforce DX
- Git
- Team Foundation Server
- Version Control
- Salesforce Testing
- Best Practices
- Troubleshooting
- Release Notes