Salesforce Lightning tests
You can record and play back Web UI tests for Salesforce applications that use Salesforce Lightning controls.
Salesforce Lightning controls are composite controls built from multiple underlying controls. During recording, an action on a composite control might be assigned to a child element. If playback does not work as expected, use Element View to select the required parent or actionable control and set it as the step target.
Smartshot capabilities
During recording, HCL DevOps Test Hub (Test Hub) captures a Smartshot for each step. For Salesforce Lightning applications, the Smartshot includes the visible controls that Test Hub recognizes. You can use the Smartshot in the test editor without recording the session again to perform the following tasks:
- Control detection: View the recognized controls in the Smartshot. The original target remains highlighted, and you can select another recognized control.
- Step generation: Select a visible control to generate an additional action, such as a click, text entry, or selection.
- Verification points: Select a visible control and capture a verification point for a property such as text, value, or visibility.
The following scenarios might require you to edit a test after recording:
- If a drop-down option is recorded as a
spanelement, then you must select the Salesforce Lightning base combo control in Element View as the step target.Note:When you record a drop-down action, click the left side of the drop-down text value. You should avoid clicking the middle or right side of the value. - For an SVG element, you must select the nearest parent Salesforce Lightning icon or primitive icon in the element hierarchy.
- After you record a test, if any step that is recorded as
spanfails during playback, you must select its actionable parent control as the target. - While recording, when you perform user actions, the highlight might be on some other element. You can ignore this behaviour.
The following table lists the supported main Salesforce Lightning controls:
| Control type | Control name |
|---|---|
| Base Combobox | SFL Base Combobox |
| Base Combobox Formatted Text | SFL Base Combobox Formatted Text |
| Button | SFL Button |
| Button Icon | SFL Button Icon |
| Combo Item | SFL Combo Item |
| Combobox (Select) | SFL Combobox (Select) |
| Date Picker | SFL Date Picker |
| Formatted Rich Text | SFL Formatted Rich Text |
| Icon | SFL Icon |
| Input | SFL Input |
| Input Field | SFL Input Field |
| Message Context Consumer | SFL Message Context Consumer |
| Messages | SFL Messages |
| Navigation Item Dropdown | SFL Navigation Item Dropdown |
| Navigation Menu Button | SFL Navigation Menu Button |
| Navigation Menu Item | SFL Navigation Menu Item |
| Picklist | SFL Picklist |
| Primitive Icon | SFL Primitive Icon |
| Primitive Input Sample | SFL Primitive Input Sample |
| Record Edit Form | SFL Record Edit Form |
| Record Edit Form Create | SFL Record Edit Form Create |
| Records Base Record Form | SFL Records Base Record Form |
| Records Detail Panel | SFL Records Detail Panel |
| Records Layout | SFL Records Layout |
| Records Layout Base Inputs | SFL Records Layout Base Inputs |
| Records Layout Block | SFL Records Layout Block |
| Records Layout Event Brokers | SFL Records Layout Event Brokers |
| Records Layout Item | SFL Records Layout Item |
| Records Layout Row | SFL Records Layout Row |
| Records Layout Section | SFL Records Layout Section |
| Records Modal Detail Panels | SFL Records Modal Detail Panels |
| Text area | SFL Text area |
| Time Picker | SFL Time Picker |