We're here to help
Salesforce CPQ testing
Salesforce CPQ (formerly Steelbrick) is a Configure-Price-Quote solution built on Salesforce Lightning. Salesforce CPQ has certain elements that make it a challenge to test using standard automation methods such as Selenium. This page describes how Provar can be used to automate Salesforce CPQ testing easily.
If you’re not yet a Provar customer, check out our Salesforce CPQ testing blog for an introduction to our Salesforce CPQ testing features.
How does Provar support Salesforce CPQ testing?
These tags are visible in the pages’ HTML. This makes them resistant to testing using traditional locators such as Field IDs and XPaths. While CSS locators can work, they tend to be brittle and complex to construct.
Provar has been extended to support Salesforce CPQ testing on a number of fronts, with a specialized type of locator available for buttons, links and text fields. Provar also supports the testing of Salesforce CPQ tables, tabs and standard screens.
Support for Salesforce CPQ v216.8
As of Provar 1.9, Provar supports the mapping and execution of Salesforce CPQ v216.8. Earlier versions of Salesforce CPQ used Shadow DOM elements which were removed by Salesforce without prior notice in the 216.x versions. Provar has resolved the issues reported to date and extended support for the ‘By Salesforce CPQ’ to include the following CPQ screens:
- Choose Price Book
- Edit Quote:
- Fields and buttons
- Table mapping
- Action icons
- Favorite Lookup: Table and button support
- Product Selection:
- Search Product
- Configure Product:
- Buttons and Tables
- Tab Option Layout
- Wizard Option Layout
- Section Options Layout
- Filter Screen and buttons
- Options in Category
- Section Option with Tab
Please note that, for existing tests mapped for CPQ versions prior to 218.x, it is recommended to remap Page Object locators for the above entities as a result of the changes imposed by Salesforce. This is the recommended approach as regrettably there is no reliable mechanism to translate locators automatically from the Shadow DOM entries. There have also been additional changes to rename some of the pageTableRow values.
Update from the Provar team on the 4th January 2019: “We are anticipating further changes as a result of the CPQ v218.x release on the 5th Jan 2019. We will endeavor to resolve any new issues identified as soon as possible. Unfortunately at this time the Salesforce CPQ team do not provide early access to their updates in the Pre-Release window, but are adopting a push-update strategy which may impact your instance.”
Testing Salesforce CPQ
Salesforce CPQ pages can be mapped in the usual way using the Test Builder. Provar will recognize standard Salesforce functionality and map it using standard Salesforce layouts, as in the example below:
Mapping Standard CPQ Fields
Standard CPQ fields can be mapped in the usual way using the Test Builder. Note that standard CPQ fields will use Provar’s standard Salesforce locators:
Below is the same step in Provar Desktop:
And in Test Runner:
Mapping custom CPQ fields
Custom CPQ fields can also be mapped using the Test Builder. Provar offers default ‘By Salesforce CPQ’ locators when mapping custom Salesforce CPQ fields.
Below is a draft test step mapping the ‘Additional Dis. (%)’ field in Test Builder:
Below is the corresponding On Screen test step in Provar Desktop:
A ‘Visualforce Page’ Page Object will be created for custom CPQ fields:
Locators with the annotation ‘@SteelBrickBy(fieldSetTableItem = “*****”)’ will be created for each CPQ field to identify them uniquely in the Page Object.
Below is the above field in the Page Object Editor view:
And in the Java Source view:
Mapping Salesforce CPQ tables
Provar also supports the testing of Salesforce CPQ tables.
Note that the Test Builder automatically recognizes the ‘Salesforce CPQ Table’ in the Product Selection example below, offering a specialized ‘By Salesforce CPQ’ locator:
The corresponding With Row step is represented as follows in Provar Desktop, showing the new Table mapped in the screenshot above:
This Table appears as follows in the Page Object Editor view:
In the Java Source view:
And in the Test Runner:
Provar also recognizes embedded blocks, as in the example below in Test Builder: