Salesforce UI testing overview: Key concepts and best practices

Salesforce UI testing overview: Key concepts and best practices

Gino Toro Pereira on

Share with



Thoroughly testing your changes before release is vital to avoid downtime in your production environment, but it can become the biggest bottleneck in the release pipeline — especially if tests are run manually.

In this post, we’ll explore the importance of Salesforce UI testing and the key differences between manual and automated approaches. We’ll also cover important considerations when evaluating Salesforce testing tools, common challenges with UI test automation, and best practices for overcoming them.

What is manual Salesforce testing?

Ensuring a high-quality Salesforce release starts with manual testing, to build confidence in the changes you’re about to ship. Ideally, issues are found and fixed before they ever reach production. But human error is inevitable — so issues will slip through at some point.

To minimize the risk of human error, businesses often invest in improving their Salesforce testing processes. While testing manually is useful for validations that require human judgment, relying on it too heavily can introduce inconsistency — especially as your Salesforce platform scales. Limitations include:

  • Release bottlenecks: As your Salesforce org grows in complexity and the pace of development accelerates, manually testing every user Flow becomes incredibly time-consuming and delays critical releases.
  • Human error: As your orgs scale and releases contain more changes, the chance for human error increases. A missed step or incorrect data entry can lead to defects being overlooked.
  • Limited coverage: Achieving comprehensive test coverage across all user profiles, customizations, and integrations through manual effort alone is challenging and often incomplete.
  • Cost analysis: Scaling manual test processes isn’t cheap and, even with a QA team of 20+ people, bugs will still happen. This can prompt difficult questions about the ROI of manual tests.

Test automation: overcoming the limitations of manual testing

The solution to the challenges of manual testing, and the key to unlocking a more robust and efficient DevOps process, lies in automating user interface testing for Salesforce. By leveraging automated testing tools and frameworks, you can significantly scale your testing capabilities and deliver higher-quality Salesforce releases.

Manual testing vs. automated testing

To reach a go/no-go decision before a release, testers must complete several steps: reviewing pages of test cases and user stories, writing new test cases, preparing the necessary test data, manually executing steps in the UI, and recording the results. They also need to write a report summarizing the outcomes and justifying their go/no-go recommendation. Repeating this testing process for every change is incredibly inefficient — and that’s where test automation makes a difference.

Let’s take a look at some of the key differences between automated and manual Salesforce UI testing:

ProcessManualAutomated
Test creationEasy to write in a central locationUser-friendly test creation with recording capabilities
ExecutingManual effort that is tediousExecuted repeatedly. It’s efficient and scalable
MaintainingProne to errors and variations as changes are made to the productScripts will need updating when UI changes
ReleasingHigh stress, risk of missing issues even with weeks of Salesforce testingConfidence through automation, when combined with other types of automated testing
Validating consistencyDifficult and time-consuming especially when judging by eyeAutomatic visual checks ensure reliability across browsers and devices
Scaling testsScales poorly needing more time and people, and increases costs — yet doesn’t guarantee improved resultsScales with reusable frameworks that support team growth without a significant increase in resources

Automated testing removes the manual clicking and repetitive execution of the same tests during QA. Once configured, tests can be reapplied — without touching the mouse — and the test results will be reported instantly. With less time spent running tests and writing up reports, teams can simply focus on maintaining the testing suite to ensure confidence in every release.

Benefits of automated Salesforce UI testing

When implemented successfully, automated UI testing enables scalable testing that empowers teams — so you can deliver high quality, secure changes at pace:

  • Catch bugs early: Find and fix issues before they impact your users, saving time and headaches. The price of software errors can increase as they progress down your development pipeline into production — the earlier issues are caught, the lower the cost to the business.

  • Enhance user experience: Ensure changes work seamlessly across all components by running different test scenarios, confirming they don’t negatively impact the user experience.

  • Improved efficiency: Test automation frees up time to focus on development and other types of system testing, instead of sinking time on manual processes.

  • Reduce impact of updates: Keep your customizations and integrations running smoothly after Salesforce releases or changes from third-party systems like DocuSign or NetSuite.

  • Ensure cross-browser and device compatibility: Guarantee consistent performance across different browsers and devices.

  • Prevent regressions: Maintain repeatability and consistency as your Salesforce environments scale.

  • Provide a safety net: Add an extra layer of confidence which provides a higher test coverage where Apex code cannot cover. For example, Screen Flow, Lightning Web Components (LWCs), emails, and in-app guidance.

The importance of end-to-end testing for your Salesforce platform

In Salesforce testing, developers typically test code — emphasizing code coverage, unit tests, and integration tests using Apex — while QA teams often manage system testing, doing end-to-end tests to help teams release their Salesforce changes. Both are vital test automation techniques and form the Testing Pyramid — which is crucial in building a robust testing strategy.

Imagine a complex business process involving metadata, Apex code, and Flows. Manually testing every scenario becomes a major bottleneck. Automation provides repeatable tests, reduces human error, and dramatically increases your release confidence. But there are metadata types in Salesforce that cannot be tested by code. For example, testing a Screen Flow requires inputting data and verifying the outcome, which is perfectly suited for automated end-to-end testing.

  • Unit tests: Tests code for each function, ensuring it is doing the correct thing independently of any other components.
  • Integration tests: Apex code that prompts a Record-Triggered Flow, by inserting a Salesforce record and ensuring all the components work together.
  • End-to-end tests: UI test that creates an order in Salesforce and fills in values for a Screen Flow, which triggers the Flows and Apex code behind Salesforce UI.

End-to-end testing is vital — but for a robust testing strategy, unit and integration testing need to be included too. Consider a scenario where a business process performs tax calculations based on a contact’s region — if an error surfaces during User Acceptance Testing on release day, especially after numerous changes, pinpointing the root cause becomes challenging. Unit tests can help identify the specific area of code responsible. Shifting left and testing each change individually enables earlier detection of breaking changes, saving time and allowing developers to resolve issues more quickly.

By combining these three types of testing, you can ensure issues are caught as early as possible, identify where it occurred, and get it fixed long before release day — whether it’s Apex, Flows, the UI, or Salesforce automation.

Automating Salesforce UI testing: choosing the right tool

Selecting the right Salesforce test automation tool depends on your business needs and team expertise. While there are many Salesforce testing tools available, it’s important to consider a few key distinctions that can help guide your decision:

  • Salesforce-aware tools: Ideal for teams focused primarily on Salesforce, offering deep integration and understanding of Salesforce metadata and its complexities, such as Provar, Eggplant, and ACCELQ.
  • Cross-platform tools: Suitable for Salesforce testing alongside other web and mobile applications, though they’re typically less aware of Salesforce-specific configurations.

Testing platforms can also be categorized by their approach:

  • No-code solutions: Automate testing with minimal or no coding using declarative language, natural language or clicking visual elements, suitable even for non-technical users.
  • Code-based solutions: A powerful tool or framework that offers flexibility and control for complex test scenarios but requires programming skills.

While code-based solutions are more flexible, a technical team of engineers would need to invest a lot of time in building, maintaining, and making the framework available to other teams. For example, UTAM (UI Test Automation Model) is an open-source, code-based test automation framework developed by Salesforce, allowing developers and QA engineers to create tests for the UI that are structured and maintainable, using JSON-defined page objects and languages like Java or JavaScript. UTAM is specifically designed to support modern web components, such as Lightning Web Components.

No-code solutions offer a simpler path to test automation, enabling non-technical teams to create repeatable test cases. Typically, tests are built as a series of expected steps or actions, which are then executed automatically during each test run.

Salesforce-specific testing tools will have more knowledge of Salesforce and its metadata, making it easier to insert or update records. Most no-code tools allow you to record the interactions you have with the Salesforce UI, save them as a test case, and automate the repetition of those steps.

Recently, there’s been a shift away from traditional testing tools that work cross-platform, and are often brittle and prone to failure when the UI changes. In these methods, any test failure requires the user to manually fix the affected steps — a tedious process that can slow down development.

When selecting the right tool for your team, think about:

  • What are the capabilities of my team? Are they technical or not?
  • What systems are we responsible for? Is it just Salesforce, or other apps too?
  • How much are we going to test?

Common challenges of automating Salesforce UI testing

Salesforce’s dynamic environment presents unique testing challenges that your testing tools must be equipped to handle. To ensure your tests remain effective over time, make sure your testing suite can handle the following:

  • Frequent Salesforce updates: Regular updates from Salesforce introducing new features or improvements require extensive regression testing to ensure nothing is broken.
  • Dynamic UI elements: Complex and changing UI elements can make test automation tricky.
  • Customizations: Unique org customizations for every team and company would require testing to be flexible to suit the needs of the team.
  • Test data management: Handling sensitive data with complex dependencies can make testing harder. Testing with data that closely mirrors production ensures repeatability and builds confidence that the changes will behave as expected when released.
  • Integration with third-party applications: Data flow issues or errors between systems can cause a disjointed user experience.
  • Lightning Web Components and Visualforce: Custom components that are unique to Salesforce require specialized knowledge.
  • Inconsistency across platforms: Ensuring consistent performance across platforms can be time-consuming.
  • Coverage vs time: Automated UI testing is faster than a human, but still takes time to run. The challenge is balancing time with coverage to ensure you do capture regressions.

Best practices for effective Salesforce UI testing

To overcome the typical challenges of UI testing, there are some testing best practices you can follow:

  • Strategic test planning and prioritization: Focus on critical user paths and adopt a risk-based approach. How do you bring all forms of testing into your strategy across all your teams?

  • Shift testing left: Start testing early into the development lifecycle. If running a full regression testing suite is too time-consuming after changes are committed to QA or staging, focus on testing only the impacted areas.

  • Robust locator strategies: Use stable locators (IDs, data-test attributes) to prevent test breakage.

  • Implement the Page Object Model (POM): Improve maintainability by encapsulating UI elements and actions.

  • Effective test data management: Use data seeding and masking techniques to bring more realistic data into your environments. This is a key part of shifting left to find issues related to data as early as possible.

  • Cross-browser and device testing: Test on various platforms using emulators and real devices.

  • Continuous integration and continuous delivery (CI/CD): Bring tests into your Salesforce automation pipeline for continuous validation across your Salesforce instances, including your sandbox environments, focussing on diagnosing issues in test runs and improving your testing strategy.

  • Effective test maintenance: Regularly update tests to align with UI changes keeping your test suite efficient to run and covering the gaps as new development is done.

Gearset: streamline your Salesforce UI testing

Streamline your UI testing by embedding automated tests into your Gearset Pipeline, enabling seamless collaboration between developers and QA. With comprehensive integrations, Pipelines automatically runs your configured testing suite whenever developers promote new changes — no manual triggers needed. Simply define which tests should run at each stage of your release pipeline for easy automated testing, and get detailed reporting that’s visible to the whole team — enabling rapid fixes for issues and progression of changes. Find out how St. James’s Place implemented testing best practices with Gearset for easy, high-quality releases.

Try all of Gearset for free