List Compare
This test step compares values of two lists of an identical structure. It can compare and report on selected columns or all columns. Lists can be compared row by row, if both lists have the same row order, or alternatively the test step can match list rows based on values in defined columns prior to making the comparison.
Drag the List Compare test step from the Test Palette into your test case.
Update the parameters as follows
- List1: The name of the first list to be compared
- List2: The name of the second lists to be compared
- Match Columns: If you want to match list rows based on values in defined columns, enter the column name(s) here (use a comma-separated list for multiple columns). This is useful for comparing lists which may not be in the same order. Alternatively, to match on Row Number, leave this parameter blank.
- Compare Columns: Comma-separated list of the names of columns to be compared and reported on. To compare and report on all columns, leave this blank
- Ignore Columns: Comma-separated list of the names of columns to be skipped
- On Differences: The reporting action to be performed if a difference occurs between the values being compared
- On Unmatched List 1 rows: The reporting action to be performed when a value in the first list does not have a corresponding value in the second. This will also occur when Match Columns have been specified but no result found. It will also occur when the comparison is done on Row Number and there is an extra row in the first list
- On Unmatched List 2 rows: The reporting action to be performed when a value in the second list does not have a corresponding value in the first
- Case Insensitive: Tick this checkbox to ignore case when comparing values
- Then save the test case
List compare examples
Below are some examples of how to use the List Compare test step to satisfy different use cases.
The test Case below compares two lists of leads containing Name and OwnerId. Each scenario queries Salesforce for an actual results list and compares it with the list of expected values stored in an Excel sheet. Four different scenarios will be described.
Scenario 1: Comparing two columns across lists with the same row order
This scenario compares Name and OwnerId in Row 1 of List 1 with Name and OwnerId in Row 1 of List 2. It continues through all rows and reports any differences.
This is defined in the parameters as follows:
Note that Match Column is blank, meaning that the match will be based on Row Number alone. Compare Columns and Ignore Columns are also blank, meaning that all columns will be compared and reported on.
If there are extra items in either list, these will be reported under Unmatched List Rows for List 1 or 2 respectively.
Note the two failures occurring at Row 4, since the Name and OwnerId values are different between List 1 Row 4 and List 2 Row 4. Note also the warning for the unmatched row in List 2.
Scenario 2: Comparing one column across lists with the same row order
This scenario compares OwnerId in Row 1 of List 1 with OwnerId in Row 1 of List 2. It continues until all rows in lists are covered, and reports any differences.
This is defined in the parameters as follows:
Note that, as in Scenario 1, Match Column is blank, meaning that the match will be based on Row Number alone. Unlike Scenario 1, Compare Column has been specified as ‘OwnerId’, meaning that only this column will be compared and reported on.
Note that, unlike Scenario 1, only a single failure occurs at Row 4, since the OwnerId value is different between the lists but the Name value has not been compared.
Scenario 3: Ignoring one column and comparing the rest across two lists with the same row order
This scenario compares OwnerId in Row 1 of List 1 with OwnerId in Row 1 of List 2. It continues until all rows in lists are covered, and reports any differences.
This is effectively the same as scenario 2, but uses the Ignore Columns parameter instead of the Compare Columns parameter:
The results are the same as for Scenario 2:
Scenario 4: Comparing all columns across two lists and matching rows using a specific value
This scenario picks the entire row (Name and OwnerId) in Row 1 of List 1 and selects the corresponding row in List 2 by matching on the OwnerId value.
If no match is found, the row is reported as an Unmatched List 1 row. If a match is found, it compares both Name and OwnerId values and reports on any differences. It continues this for all List 1 rows and then runs the same process for all List 2 rows.
Note that Match Column is set to Name, meaning that the match will be based on the values in the Name column. The Compare Column is also blank, meaning that all columns will be compared and reported on.
Note that a failure occurs at List 1 Row 3 since the OwnerId values are different between the lists. In addition, there are three unmatched row warnings: Row 4 in List 1 and Row 4 and Row 8 in List 2.
Note that using Match Columns in this scenario has generated more unmatched row warnings than using Row Number. In this example, the Name value of Row 4 is slightly different between Lists 1 and 2, leading Shelly Brownell and Shelly Brownell (Diff) being treated as two unmatched rows, rather than a column difference.
- 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
- Understanding Provar’s Use of AI Service for Test 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
- Customize Browser Driver Location
- 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