UI Assert
This test step checks the values or attributes of a UI field and compares them to the expected values. This is most useful for when fields on a UI need to have their values and/or behavior checked in a functional testing flow. This test step can also be used to check messages on a page, using a Page Assertion, or values in a column, using a Column Assertion.
Usage
It is often best to add this test step through the Test Builder by mapping the field and selecting an Interaction Type of Read/Assert. This is recommended as the fastest way to add this kind of test step, although it is also possible to use drag-and-drop from the Test Palette.
A UI Assert can test the following:
- Field values
- Field attributes (e.g., Read Only, Visible)
- Messages thrown on operations like Save (e.g., validation rule error messages, page-wide messages)
- Column header names in tables (e.g., a related list)
- Column values
- Count or number of items in a column
Adding multiple asserts
Note that more than one Assert can be added to a single test step, providing that the Asserts are all of the same type (see Asserting Fields vs. Asserting Fields in Tables below). The best method for doing this is to use the icons identified below.
If multiple Asserts are used in the same test step, the result of the assertions will be stored in a list.
Asserting standalone fields vs. asserting fields in tables
Assert parameters
In this example, the Assert checks a specific validation error message for the Account Number field. The expected message is defined precisely, and it is Case Sensitive.
In addition, this Assert will also Read whether the field is Visible and will check that the field equals Read Only. Note the difference between Read (to capture an attribute and place it in a Results variable) and Equals (to test for a specific attribute condition and return TRUE or FALSE).
The full Field Assertion attributes are as follows:
- Field: The name of the field to be asserted. This will be auto populated based on the UI On Screen or UI With Row parent Test Step
- Value: Defines any expected field value
- Message: Defines any expected validation message against the field (e.g., after Save is clicked)
- Visible: Checks whether the field is visible on the page layout (based on the permissions associated with the user credentials through which the Salesforce Connection has been made)
- Disabled: Checks whether the field is disabled or enabled
- Read Only: Checks whether the field is Read-Only or Editable
- Focused: Checks whether the tab focus is on the current field
- Inline Editable: Checks whether the field can be ‘inline edited’, i.e., editable from the View screen without navigating to the full Edit screen
- In View: Checks whether the field is visible onscreen without scrolling based on the current browser size
- Options: Checks the metadata options available for the field (applies to picklist fields only)
Note that these parameters are optional except for Field. The other parameters will appear when selected from Test Builder or when clicking the Add the Field Assertion Attributes located in the Test step parameters.
The full list of operators is as follows:
- Ignore: Shows that an attribute should not be checked
- Read: Captures the attribute and places it in a Results variable
- Equals: Checks an attribute against an expected string (returns TRUE or FALSE)
- Contains: Checks whether the attribute includes a defined value-string within it (returns TRUE or FALSE)
- Starts with: Checks whether the attribute begins with a defined value-string (returns TRUE or FALSE)
- Ends with: Checks whether the attribute ends with a defined value-string (returns TRUE or FALSE)
- Matches: Matches the attribute value with a defined value-string (returns TRUE or FALSE)
Page assertions
To test messages on a page, a Page Assertion can be used. This will capture all messages in a list, which can then be checked against a defined string value.
Column assertions
A Column Assertion can be used to test the attributes or values of a column within a table. This has the following parameters:
- Column: The Name of the Column which should be asserted. This will auto-populate based on the table captured in the UI On Screen or UI With Row parent test step.
- Column Values: Reads the number and values of all the column items and adds them to a list.
- Column Visible: Check whether the column can be seen on the page layout.
- Heading Text: Compares the column’s title against a defined string value.
Note that Column Values, Column Visible, and Heading Text can be set to Ignore if they are irrelevant to the scenario. For example, it may be necessary only to test whether the column is visible or has a specific title.
Example: Asserting fields
In this example, the UI Assert test step is used to assert the value and some attributes of the Account Name field and the Type picklist field.
Step 1: The Test Builder is launched, and a specific Account record is navigated.
Step 2: The Account Name is mapped as a test step by right-clicking on the field and selecting Add to Test Case.
Step 3: The Draft test step is configured as follows:
Note that the Expected Attributes section will not be visible in Test Builder for some Provar versions. These attributes can be configured within Provar Desktop once the test step has been added.
The Extract Value and Assert Value checkboxes are both ticked. The Expected Value is set to the name of the Account (Test Builder will generally prefill this, but the value can be changed as wanted).
Note: The information gathered in the Assert is visible in the Test Runner and the Variables view for each test step. The Values variable demonstrates the values collected through the Account Name Assert.
The execution results are also visible in the Test Builder by right-clicking on a given step and selecting View Test Step Output.
Step 6: To complete the test steps, you can rename the UI Assert step so that their purpose can be easily understood.
- Provar Automation
- System Requirements
- Browser and Driver Recommendations
- Installing Provar Automation
- Updating Provar Automation
- Licensing Provar
- Granting Org Permissions to Provar Automation
- Optimizing Org and Connection Metadata Processing in Provar
- Using Provar Automation
- Provar Automation
- Creating a New Test Project
- Import Test Project from a File
- Import Test Project from a Remote Repository
- Import Test Project from Local Repository
- Commit a Local Test Project to Source Control
- API Testing
- Behavior-Driven Development
- Consolidating Multiple Test Execution Reports
- 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
- Japanese Language Support
- Override Auto-Retry for Test Step
- Mapping and Executing the Lightning Article Editor in Provar
- Managing Test Steps
- Namespace Org Testing
- NitroX
- Provar Test Builder
- ProvarDX
- 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 Data Generation
- 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
- How to Use Provar Manager
- Provar Manager Setup
- Provar Manager Integrations
- Release Management
- Test Management
- Test Operations
- Provar Manager and Provar Automation
- Setting Up a Connection to Provar Manager
- Object Mapping Between Automation and Manager
- How to Upload Test Plans, Test Plan Folders, Test Plan Instances, and Test Cases
- Provar Manager Filters
- Uploading Callable Test Cases in Provar Manager
- Uploading Test Steps in Provar Manager
- How to Know if a File in Automation is Linked in Test Manager
- Test Execution Reporting
- Metadata Coverage with Manager
- Provar Grid
- DevOps
- Introduction to Provar 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
- 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
- Version Control
- Salesforce Testing
- Recommended Practices
- Salesforce Connection Best Practices
- Improve Your Metadata Performance
- Java 21 Upgrade
- Testing Best Practices
- Automation Planning
- Supported Testing Phases
- Provar Naming Standards
- Test Case Design
- Create records via API
- Avoid using static values
- Abort Unused Test Sessions/Runs
- Avoid Metadata performance issues
- Increase auto-retry waits for steps using a global variable
- Create different page objects for different pages
- The Best Ways to Change Callable Test Case Locations
- Working with the .testProject file and .secrets file
- Best practices for the .provarCaches folder
- Best practices for .pageObject files
- Troubleshooting
- How to Use Keytool Command for Importing Certificates
- Installing Provar After Upgrading to macOS Catalina
- Browsers
- Configurations and Permissions
- Connections
- DevOps
- Error Messages
- Provar Manager 3.0 Install Error Resolution
- Provar Manager Test Case Upload Resolution
- Administrator has Blocked Access to Client
- JavascriptException: Javascript Error
- macOS Big Sur Upgrade
- Resolving Failed to Create ChromeDriver Error
- Resolving Jenkins License Missing Error
- Resolving Metadata Timeout Errors
- Test Execution Fails – Firefox Not Installed
- Selenium 4 Upgrade
- Licensing, Installation and Firewalls
- Memory
- Test Builder and Test Cases
- Release Notes