UI tests
Scriptless browser tests: record in Salesforce, run against any org and after CI deployments.
UI tests checks that the org still works for people after a release: scriptless browser tests that click through Salesforce the way a user would, run headless against any org, and after CI deployments.
Write or record a suite
New suite, give it a name, and add steps:
| Step | What it does |
|---|---|
| Go to | Opens a path in the org, e.g. /lightning/o/Opportunity/new |
| Click | Clicks the button, link or tab with that label |
| Type into | Types into the field with that label |
| Choose | Picks an option in the picklist with that label |
| Expect text | Fails unless the text appears |
| Expect URL contains | Fails unless the URL contains the text |
| Wait | Pauses for some milliseconds |
Elements are found by their accessible name (label, aria-label, button text), which works
through Lightning's shadow DOM and keeps working when the layout changes.
To record instead: save the suite, drag Record in Salesforce to your browser's bookmarks bar, open the Salesforce page to start on, and click the bookmark. A Diffbridge window opens and collects your clicks and field changes as steps; Save adds them to the suite. Add Expect text checks in the editor afterwards.
Run it
Pick an org at the top and click Run on …. Diffbridge opens the org in headless Chrome with the org's own session (no password needed), runs the steps, and shows each step's result, how long it took, and a screenshot of the page when a step fails. Demo orgs have a small Salesforce-like app, so you can try UI tests without Salesforce.
After CI deployments
On a CI job, choose a Built-in UI test suite after a successful run. When the job's validation or deployment succeeds, the suite runs against the target org; the result shows on the deployment, failures send a CI job failed notification, and pull request validations get a Diffbridge UI tests status check. (Prefer Provar, Selenium or Tricentis? Use the external UI test hook instead; see CI jobs.)
Self-hosting: UI tests need Chrome or Chromium on the server. Set
CHROME_PATH, or build the Docker image with--build-arg WITH_CHROMIUM=true.