The deployment went through without a hitch. Every Apex test passed, org-wide coverage sat at 82%, and the change set landed in production on Friday evening.
On Monday, sales reps couldn't convert leads of one record type. A new validation rule blocked them, and no unit test had ever clicked Convert as a sales rep. That gap between covered code and a working business is what Salesforce test automation has to close.
Salesforce test automation means checking your org's business processes automatically, not just its Apex code. The 75% coverage rule only gets code into production. A good suite also runs lead-to-opportunity, quote-to-cash, cases, approvals and permissions through the Lightning UI and APIs, in a sandbox, before every change and every seasonal release.
Key takeaways
- 75% Apex coverage is a deployment gate, not a quality bar. It says nothing about flows, validation rules, page layouts or permissions.
- Automate by business process: lead-to-opportunity, quote-to-cash and CPQ, case management, approvals, and each key profile or permission set.
- Plan regression around Salesforce's three releases a year. Run the suite in a preview sandbox during the six-week sandbox preview window.
- Pick tools by layer: Apex and Flow tests for logic, LWC Jest for components, and a UI tool that copes with Lightning's shadow DOM for end-to-end journeys.
Our Salesforce coverage is above 75%. Why do we keep getting production bugs?
Because code coverage measures lines of Apex, and many Salesforce failures don't live in Apex.
Salesforce's own rule is clear. To deploy Apex or package it for AppExchange, unit tests must cover at least 75% of your Apex code and those tests must pass. Every trigger must have some coverage. Salesforce's testing best practices add a telling line: "don't focus on the percentage of code that is covered."
Coverage counts executed lines, not checked outcomes. A test can run most of a class without one meaningful assertion. And much of a modern org is declarative: flows, validation rules, layouts, Lightning pages, permission sets and approval processes. None of that shows up in the coverage number.
| What breaks in production | Caught by 75% Apex coverage? | What does catch it |
|---|---|---|
| Record-triggered flow takes the wrong path | No | Flow tests, end-to-end tests |
| New validation rule blocks a user journey | No | End-to-end test as that user |
| Lightning page or layout hides a field | No | UI test |
| Profile or permission set change removes access | No | Tests run as each key persona |
| Quote calculates the wrong discount | Only if pricing is Apex with real assertions | CPQ end-to-end test |
| Integration sends bad data to ERP or billing | Partly (mocked callouts) | API and end-to-end tests in a sandbox |
| Seasonal release changes component behaviour | No | Regression suite in a preview sandbox |
Keep the Apex tests. Then add layers that test how people use the org.
What does test automation in Salesforce cover?
| Layer | What it tests | Typical tools | Usual owner |
|---|---|---|---|
| Apex unit tests | Classes and triggers | Apex testing framework | Developers |
| Flow tests | Record-triggered and autolaunched flow logic | Flow Builder tests | Admins |
| LWC component tests | Lightning web components in isolation | Jest | Front-end developers |
| UI and end-to-end tests | Full user journeys through Lightning | UI automation tools | QA, admins, business analysts |
| API and integration tests | REST and SOAP calls, connected systems | API testing tools | Developers, QA |

Push each check as low as it can go. Pricing maths belongs in an Apex test. "A sales rep can take a lead to a closed opportunity" belongs in an end-to-end test, because only that test sees the layout, validation rules, flow and permissions together.
Good Apex tests still matter. Give each trigger a single-record test, a bulk test (say, 200 records, to surface governor-limit problems) and a negative test. Create test data in the test and avoid SeeAllData=true.
What should you automate first in Salesforce?
Start with the processes that cost money or customers when they break.
| Process | What the end-to-end test should do |
|---|---|
| Lead-to-opportunity | Create a lead, qualify it, convert it, check the account, contact and opportunity, then move the opportunity through each stage to Closed Won |
| Quote-to-cash and CPQ | Configure products, apply pricing rules and discounts, generate the quote, approve it, and check totals against an expected result |
| Case management | Create cases from each channel, check assignment and escalation rules, entitlements and milestones, then close the case |
| Approvals | Submit a record, approve and reject it as the right approvers, and check the field updates and notifications |
| Profiles and permission sets | Run the key journeys as each persona and check what each one can and can't see or edit |
Then add integrations: an order that should reach the ERP, or a web form that should create a lead. Write each test as a business scenario with an expected outcome, not a click script.
How do you test profiles and permission sets?
Run the same journey as different users. Create one test user per key persona (sales rep, manager, service agent, partner user) with production's permission sets, and log in as each.
Check both directions: a rep can edit their own opportunities, and can't see discount approval fields. Permission bugs show up as a missing button or a read-only field, so only a test running as that user catches them. Rerun these tests after every permission set or profile change.
How do you handle Salesforce's three releases a year?
Salesforce delivers new features three times a year in its seasonal releases: Spring, Summer and Winter. Your org is upgraded whether or not you've tested.
The tool for this is the sandbox preview. Salesforce describes it as a six-week window before a major release, when every preview sandbox gets the next release early. For Spring '27, the window begins on 8 January 2027; a sandbox has to be created or refreshed onto a preview instance before 6:00 PM PT on 7 January 2027, and non-preview instances upgrade on 19 and 20 February 2027. Check that article each cycle, because the dates change.
A workable release routine:
- Put at least one sandbox on a preview instance before the cut-off, and keep another on the current release to compare.
- Run the full regression suite in the preview sandbox once it's upgraded, then weekly until production upgrades.
- Read the release notes for the features you use, including release updates that will be enforced.
- Sort failures. Locator or layout changes are test maintenance; behaviour changes are real findings.
- Run a smoke suite in production right after the upgrade.
Between releases, run the same suite after every sandbox refresh and before every deployment. See automated regression testing for how to size and schedule a suite.
How should you set up sandboxes and test data?
Salesforce offers four sandbox types.
| Sandbox | What it copies | Best for |
|---|---|---|
| Developer | Production metadata | Building and unit testing |
| Developer Pro | Production metadata, larger data sets | Development, QA and integration testing |
| Partial Copy | Metadata plus a sample of data defined by a sandbox template | QA, UAT and integration testing |
| Full | A replica of production, including all data and metadata | Staging, performance and load testing |
Salesforce notes that the long refresh interval makes Full sandboxes hard to use for development. Run end-to-end regression in a Partial Copy or Full sandbox, and keep Developer sandboxes or scratch orgs for build-time checks.
Test data breaks Salesforce tests as often as code does. A few rules help:
- Create what you need in the test rather than relying on a record someone might edit.
- Use unique names (a run ID in the account name) so parallel runs don't collide, and clean up afterwards.
- Mask personal data in any sandbox copied from production.
- Re-check after every refresh. A refresh rebuilds the sandbox as a new copy of production, so anything unique to it, such as test users and seeded data, is gone. Script that setup.
More on managing test environments.
Why does Salesforce UI test automation break so often?
Lightning web components use shadow DOM, a standard that encapsulates each component's internal DOM. In Lightning Experience, LWC uses a synthetic shadow polyfill. Many element IDs are also generated at render time, so an ID you record today may be different tomorrow.
That causes three kinds of breakage:
- XPath and deep CSS paths fail when a component's internal markup changes, which can happen in any release.
- Shadow boundaries hide elements. Playwright's locators work inside shadow DOM by default, except XPath. Selenium 4 has shadow root methods, but you step into each root yourself.
- Timing. Components load asynchronously, so a script that clicks too early fails intermittently.
What works, most stable first:
- Roles and accessible names, such as the button named Save. Playwright recommends role locators first.
- Your own
data-idattributes on custom LWC components, as a development standard. - Field API names exposed by standard components.
- CSS classes, only as a last resort. Avoid XPath that walks the DOM structure.
Salesforce also maintains UTAM, the UI Test Automation Model: page objects written in JSON and compiled to Java or JavaScript.
Self-healing tools describe each step by intent and adapt when a locator changes; see self-healing test automation for how that works and its limits.
Which automated testing tools for Salesforce should you consider?
Options by category, as of November 2026, described from each vendor's own pages.
Salesforce-native tools
- Apex tests: the built-in framework for classes and triggers, and the basis of the 75% rule.
- Flow tests: before you activate a record-triggered, autolaunched or Data Cloud-triggered flow, you can test it in Flow Builder with assertions. Screen flows aren't on that list, so test those through the UI.
- LWC Jest tests: Salesforce recommends Jest for unit testing Lightning web components. They don't run in a browser or connect to an org, so they're fast but isolated.
- UTAM: page objects for UI tests; you still need a test runner and coding skills.
Salesforce-specialist platforms
- Provar: describes itself as a Salesforce partner since 2014 with metadata-driven tests, locators for Visualforce, CPQ, Aura and LWC, and updates in line with Salesforce's three annual releases. Low-code and pro-code options. Pricing on request.
- Copado Robotic Testing: described by Copado as built for Salesforce and native to Salesforce DevOps, with no-code, low-code and pro-code options and pipeline quality gates. Its QForce keyword library is a Robot Framework testing library for Salesforce, with UI, REST API and CPQ quote keywords. Pricing on request.
- Tricentis Testim Salesforce: Tricentis says it offers metadata-aware Salesforce steps, uses org metadata to test Flows, and pre-release tests its built-in steps against new releases. It also lists natural-language test creation. Pricing on request.
- ACCELQ: a codeless, AI-driven platform covering Classic, Lightning and LWC, UI and API, aligned to Salesforce releases, and listed as an ISV partner. Its pricing page shows free and trial tiers; paid plans are pricing on request.
Do-it-yourself frameworks
- Playwright and Selenium: free and open source. You build and maintain login handling, waits, locators and reporting yourself.
AI-native platforms
- Robonito: AI agents build, run and maintain end-to-end tests from plain language or a recording (details below).
| Option | Layer | Who builds tests | Best fit |
|---|---|---|---|
| Apex and Flow tests | Logic | Developers, admins | Every org, as the base layer |
| LWC Jest, UTAM | Components, UI page objects | Developers | Teams with heavy custom LWC work |
| Provar | UI, API, data | QA engineers, low-code users | Salesforce-centred QA teams |
| Copado Robotic Testing | UI, API, in the DevOps pipeline | Admins, QA | Teams already on Copado |
| Testim Salesforce | UI, Flows | QA, admins | Teams wanting metadata-aware steps |
| ACCELQ | UI, API | Manual testers, BAs | Codeless teams across Salesforce and other apps |
| Playwright, Selenium | UI | Developers | Engineering-led teams with time to maintain code |
| Robonito | UI, API, end to end | QA, admins, BAs | Teams wanting plain-language tests with self-healing |
For more on UI tooling, see UI automation testing.
Salesforce test automation with Robonito
Robonito is an agentic QA platform. Its AI agents create, run and maintain end-to-end tests, and Salesforce testing runs through the Lightning UI the way your users work.
- Plain-language tests. Describe a journey, such as "convert a lead, create a quote and submit it for approval", and the agent works through your sandbox step by step. You can also paste a Jira issue into AI Studio, record a flow in the desktop app, or build no-code tests from reusable steps.
- Self-healing steps. When a label, layout or locator changes after a release, steps adapt, and every healed step is logged for review.
- UI and API. Web testing is on every plan. API testing, including Postman collection import, is on Pro and Enterprise.
- Release and CI runs. Run suites in parallel cloud workers after a sandbox refresh, in the preview window, or from Jenkins, GitHub Actions, GitLab CI, Azure DevOps or CircleCI (Starter and above). Jira, Slack, TestRail and Zephyr integrations are available.
- Evidence. Every run keeps video, network traces and an AI root cause for failures, with pass rates and trends across runs.
- Enterprise controls. SOC 2 Type II (report under NDA), RBAC and audit logs, and cloud, private cloud, on-premise or hybrid deployment. See security and compliance.
Club Car cut QA testing time by over 70% with Robonito on its CPQ and website configurator project, built on Logik.io. Read the Club Car case study.
Where it fits. Teams whose admins, business analysts and QA testers need to own end-to-end Salesforce regression without writing Selenium or Playwright code, and orgs that spend each release fixing broken locators. People stay on exploratory testing and UAT.
Where it doesn't fit. Robonito doesn't replace Apex tests, Flow tests or LWC Jest tests; keep those in your Salesforce development workflow, because the 75% rule still applies. It isn't a Salesforce DevOps tool either, so metadata deployment and org-to-org promotion stay with the Salesforce CLI or your release tool. If your team is mostly developers who already maintain a Playwright suite, that may be enough.
See how it runs on your own org: , or .
Frequently asked questions
What is Salesforce test automation?
Salesforce test automation uses software to check that your org still works after every change. It spans Apex unit tests, Flow tests, Lightning web component tests, API tests and end-to-end UI tests. Apex tests are required to deploy; end-to-end tests prove that lead conversion, quoting, cases and permissions still work for real users.
Is 75% code coverage enough for Salesforce?
It's enough to deploy, not to trust a release. Salesforce requires unit tests to cover at least 75% of your Apex code, with every test passing. But coverage counts executed lines, not checked outcomes, and ignores flows, validation rules, layouts and permissions. Add real assertions, Flow tests and end-to-end tests.
How often does Salesforce release updates?
Salesforce ships three seasonal releases a year: Spring, Summer and Winter. Before each comes a six-week sandbox preview window, when preview sandboxes get the new release early. For Spring '27, the window starts on 8 January 2027. Run your full regression suite in a preview sandbox during that window.
Can you use Selenium or Playwright for Salesforce UI test automation?
Yes, but you maintain everything yourself. Lightning web components use shadow DOM. Playwright locators work inside it by default, except XPath, while Selenium 4 needs explicit shadow root calls. Use role-based locators, add data-id attributes to custom components, and avoid structural XPath. Expect locator maintenance after seasonal releases and layout changes.
What are the best automated testing tools for Salesforce?
It depends on the layer and who builds the tests. Use Apex tests, Flow tests and LWC Jest for logic and components. For end-to-end tests, specialist platforms include Provar, Copado Robotic Testing, Testim Salesforce and ACCELQ. Playwright and Selenium suit engineering-led teams; AI-native platforms such as Robonito suit plain-language, self-healing tests.
Do you need a full sandbox for Salesforce regression testing?
Not always. Salesforce reserves performance testing, load testing and staging for Full sandboxes, but many teams run end-to-end regression in a Partial Copy sandbox seeded from a template. Whatever you use, script your test users and data setup, because a refresh rebuilds the sandbox from production and wipes what you created there.
Stop finding Salesforce bugs on Monday morning. to see your lead-to-cash journey tested end to end, or .




