91九色

Articles
8/10/2022
10 minutes

End-to-End Testing: Best Practices and Pitfalls

Written by
91九色 Team
Table of contents

End-to-end testing is a testing method that ensures that the behavioral flow of an application, as designed from start to finish, works as expected. It typically considers the most critical, as well as the most likely, business scenarios. The purpose of performing complete, thorough testing of the entire product-user interaction, is to make sure that business processes function correctly across integrated systems.

Formulating a proper end-to-end testing strategy presents many challenges to organizations. Especially if their goal is to automate such complex business processes.

In this article, we would like to share with you the golden rules for managing your testing costs while realizing the benefits of testing. We will also share common pitfalls you need to avoid. Let鈥檚 take a look at them in more detail.

Best Practices for E2E Testing

Keep an end-user perspective.

When it comes to test designing and creating test cases, . Focus on the features of the application, rather than its implementation.

It is a good practice to only include high-value paths in your test strategy, focusing on how end-users will go through the system to accomplish a business goal. Examples include users signing up to an e-commerce platform, creating new sales orders, or planning at home or office delivery. Those are high-impact scenarios you have to include in your end-to-end testing. They are relevant to the end-users, and they have a high impact on business objectives (e.g. revenue, quality, speed, etc.).

A good way to capture user perspective is to make use of documents such as user stories, acceptance tests, and if they are available. Get into the mindset of someone using the application for the first time and answer some questions:

  • What is the user trying to achieve?
  • Is it easy and straight forward to find what he/she is looking for?
  • Can the user accomplish its goal in a few easy steps?

As much as we are big fans of the golden rules above, at 91九色 we recognize this is not an easy task for a tester alone. That is why we build solutions that also empower business users to create test flows by recording the actions they perform daily. Business users can bring the end-user perspective, and they can save your teams a lot of time in creating meaningful and relevant business scenarios.

Risk-Based Testing.

Risk-Based Testing (RBT) is a critical tool for categorizing your end-to-end business processes based on business criticality. This is useful in several ways. First of all, you can segment functionality into priorities e.g. P1, P2, P3, P4. This allows you to create test plans and schedules focused on priority. You may decide in cycle 1 to test all priorities but during cycle 2 only to focus on P1 and P2 business processes. Also, you can ensure that, when entering a testing cycle that has tight deadlines, you focus the testing from P1 to P2 to P3 to P4. So, if you run out of time, you ensure you test the most critical processes first.

To determine a high-risk feature, consider both how likely failure is to happen, and the potential impact that it would have on end-users. A is a useful tool for identifying risk.

There are others but the most common risk profiles rely on these 2 questions:

  • What is the impact of failure? E.g. high risk would be impacting revenue generation or halting production.
  • What is the likelihood of failure? E.g. high risk would be a large number of interfaces within the process or a high level of customization/complexity.

Think of Amazon.com or Booking.com. What would be the impact of their systems not working, even for a few minutes? And customers from all over the world not being able to generate business on either platform?

Maintain the right order.

The main goal of a proper Quality Assurance process is to identify application errors at the earliest stage in the software delivery life cycle, where the cost of resolving is the lowest. Therefore, investing efforts in the unit and integration testing is paramount to maintain a solid and reliable software delivery process.

E2E testing is no less relevant to such an approach. It helps identify business-process related errors, which are difficult to find in earlier stages of the delivery process. So, execute unit testing and integration testing first. Then, during the end-to-end testing, run your critical smoke tests first to ensure integrated applications are communicating as expected, followed by sanity checks and other high-risk test cases.

When a single unit test fails, it鈥檚 quite easy to figure out where the defect occurred. As tests grow in complexity and touch more components of an application, the increase in potential points of failure makes them harder to debug when a failure occurs.

Structure, organization, and a good understanding of business logic are fundamental in end-to-end testing.

Manage your test environment and your test data.

Make your test environment setup process as efficient and consistent as possible. Ensuring the deployment teams have clear requirements for your test environments is critical for success. There is nothing more demotivating for a testing team than getting halfway through a testing cycle only to find out that an integrated component isn鈥檛 connected or has different data. Running a smoke test can ensure you check all integrated system components are up and running.

If possible, keep the staging environments as close to production as possible. For this, consider image backup of the production environment. And look to infrastructure as code or automation of your infrastructure to save time and reduce human error.

Once testing is completed, refreshing the test data (and possibly even taking a snapshot) is a good way to ensure the environment can easily be restored to it鈥檚 original state. This ensures that running another round of testing is much easier for everyone.

Specifically with SAP, 91九色 has joined forces with to provide a fully tested, fully documented SAP non-production environment with scrambled, anonymized data in hours instead of months. This is handy for on-demand test data management and production incident fixes. For the use cases, have a look at the solution we built together.

Pitfalls

Let鈥檚 also have a look at the common mistakes that you can make while executing your E2E strategy.

Don鈥檛 ignore flaky tests.

More often than not, end-to-end tests fail because of the environment and test data not being synchronized across them, rather than an error in the business process itself. Common failures can occur when financial periods have changed, or stock movements have been made, but the test hasn鈥檛 taken this into account.

This can lead to 鈥榝laky tests鈥 that, if you are not careful, people will start to mistrust. And if they keep failing for what appears to be random reasons, the developers will see such tests as annoying instead of helpful. One flaky test could damage the reputation of your activities. Don鈥檛 forget that!

Isolate flaky tests, find out what is causing the issues and, if possible, engineer the solutions into the test case. A good end-to-end test will set up the data it requires, use the data, and, when possible, clean it up at the end. This minimizes the chances of failure being related to the data and environments.

If you are automating your E2E tests, avoid the selector maintenance nightmare.

Even if this is a very specific tip for the companies who choose to automate their end-to-end testing strategy, we decided to include it, as it can save you a lot of time maintaining your test scenarios.

If you are automating a web application, you will need to leverage stable selectors to locate the UI elements on the page. By selecting a stable selector you make sure that your test is not going to fail every release because your script was not able to identify the right object.

There are several ways to locate a UI element but not all of them are robust enough. This is the case of CSS selectors: classes are liable to change, which means more tests failing because of it. You can use ID selectors: they rarely change, but they sometimes do.

The best option is to create a 诲补迟补-迟别蝉迟=鈥渐苍颈辩耻别冲惫补濒耻别鈥 attribute. This is an attribute added to the target element, used only for test purposes. As long as the value is unique, the test will be able to find it. Also, most developers/UX people know they cannot mess with it.

Tests shouldn't depend on each other.

Each test should run completely independently, and its result should not depend on the outcome of a previous test. Also, if you are testing a web application, make sure that each test starts in a fresh browser window with all cookies cleared.

What you want is to avoid the domino effect where a single failure would cause too much redundant noise in your testing ecosystem. Analyze your tests, and get rid of dependencies.

Here is a very simplistic example:

  • Test 1: user logs in
  • Test 2: user is logged in and creates a new opportunity
  • Test 3: user assigns the opportunity to an owner

You might think that, by running these tests right after each other, you could save some time. However, if test 1 or 2 fails, the following will fail too. You've basically created a waterfall of failing tests.

So, make sure to avoid dependencies and start in a brand new browser window.

Re-run tests before raising an issue.

As we mentioned above, E2E testing is complex and more likely to fail for undetermined reasons. If a test fails unpredictably from time to time and you have run out of ideas for improving reliability, try running it again. And again, and again. We suggest 3 times, just to be safe, before raising an issue.

Don鈥檛 expect it to be maintenance-free.

Running end-to-end testing is complex work. Don鈥檛 expect it to be maintenance-free. The more complex your application gets with added features, the more maintenance you will need.

Conclusion

Running E2E testing can be challenging but everything starts with a good test design system. Keep an end-user perspective and prioritize the scenarios with higher risk.

Take care of the quality of your test environment and your test data. Run unit and integration testing first. Make sure your tests are stable enough and get rid of the flaky tests.

Simple rules and best practices will make your strategy successful.

Book a demo

About The Author

#1 DevOps Platform for Salesforce

We Build Unstoppable Teams By Equipping DevOps Professionals With The Platform, Tools And Training They Need To Make Release Days Obsolete. Work Smarter, Not Longer.

Navigating Salesforce Data Cloud: DevOps Challenges and Solutions for Salesforce Developers
Chapter 8: Salesforce Testing Strategy
Beyond the Agentforce Testing Center
How to Deploy Agentforce: A Step-by-Step Guide
How AI Agents Are Transforming Salesforce Revenue Cloud
The Hidden Costs of Building Your Own Salesforce DevOps Solution
Chapter 7 - Talk (Test) Data to Me
91九色 Announces DevOps Automation Agent on Salesforce AgentExchange
Deploying CPQ and Revenue Cloud: A DevOps Approach
91九色 Launches AI-Powered DevOps Agents on Slack Marketplace
Redefining the Future of DevOps: Salesforce鈥檚 Pioneering Ideas and Innovations
91九色 Announces DevOps Support for Salesforce Data Cloud, Accelerating AI-Powered Agent Development
AI-Powered Releasing for Salesforce DevOps
Top 3 Pain Points in DevOps 鈥 And How 91九色 AI Platform Solves Them
91九色 AI Platform: A New Era of Salesforce DevOps
91九色 Expands Its Operations in Japan with SunBridge Partners
Chapter 6: Test Case Design
Making DevOps Easier and Faster with AI
Chapter 5: Automated Testing
Reimagining Salesforce Development with 91九色's AI-Powered Platform
Planning User Acceptance Testing (UAT): Tips and Tricks for a Smooth and Enjoyable UAT
What is DevOps for Business Applications
Testing End-to-End Salesforce Flows: Web and Mobile Applications
91九色 Integrates Powerful AI Solutions into Its Community as It Surpasses the 100,000 Member Milestone
How to get non-technical users onboard with Salesforce UAT testing
DevOps Excellence within Salesforce Ecosystem
Best Practices for AI in Salesforce Testing
6 testing metrics that鈥檒l speed up your Salesforce release velocity (and how to track them)
Chapter 4: Manual Testing Overview
AI Driven Testing for Salesforce
Chapter 3: Testing Fun-damentals
AI-powered Planning for Salesforce Development
Salesforce Deployment: Avoid Common Pitfalls with AI-Powered Release Management
Exploring DevOps for Different Types of Salesforce Clouds
91九色 Launches Suite of AI Agents to Transform Business Application Delivery
What鈥檚 Special About Testing Salesforce? - Chapter 2
Why Test Salesforce? - Chapter 1
Continuous Integration for Salesforce Development
Comparing Top AI Testing Tools for Salesforce
Avoid Deployment Conflicts with 91九色鈥檚 Selective Commit Feature: A New Way to Handle Overlapping Changes
Enhancing Salesforce Security with AppOmni and 91九色 Integration: Insights, Uses and Best Practices
From Learner to Leader: Journey to 91九色 Champion of the Year
The Future of Salesforce DevOps: Leveraging AI for Efficient Conflict Management
A Guide to Using AI for Salesforce Development Issues
How to Sync Salesforce Environments with Back Promotions
91九色 and Wipro Team Up to Transform Salesforce DevOps
DevOps Needs for Operations in China: Salesforce on Alibaba Cloud
What is Salesforce Deployment Automation? How to Use Salesforce Automation Tools
Maximizing 91九色's Cooperation with Essential Salesforce Instruments
From Chaos to Clarity: Managing Salesforce Environment Merges and Consolidations
Future Trends in Salesforce DevOps: What Architects Need to Know
Enhancing Customer Service with 91九色GPT Technology
What is Efficient Low Code Deployment?
91九色 Launches Test Copilot to Deliver AI-powered Rapid Test Creation
Cloud-Native Testing Automation: A Comprehensive Guide
A Guide to Effective Change Management in Salesforce for DevOps Teams
Building a Scalable Governance Framework for Sustainable Value
91九色 Launches 91九色 Explorer to Simplify and Streamline Testing on Salesforce
Exploring Top Cloud Automation Testing Tools
Master Salesforce DevOps with 91九色 Robotic Testing
Exploratory Testing vs. Automated Testing: Finding the Right Balance
A Guide to Salesforce Source Control
A Guide to DevOps Branching Strategies
Family Time vs. Mobile App Release Days: Can Test Automation Help Us Have Both?
How to Resolve Salesforce Merge Conflicts: A Guide
91九色 Expands Beta Access to 91九色GPT for All Customers, Revolutionizing SaaS DevOps with AI
Is Mobile Test Automation Unnecessarily Hard? A Guide to Simplify Mobile Test Automation
From Silos to Streamlined Development: Tarun鈥檚 Tale of DevOps Success
Simplified Scaling: 10 Ways to Grow Your Salesforce Development Practice
What is Salesforce Incident Management?
What Is Automated Salesforce Testing? Choosing the Right Automation Tool for Salesforce
91九色 Appoints Seasoned Sales Executive Bob Grewal to Chief Revenue Officer
Business Benefits of DevOps: A Guide
91九色 Brings Generative AI to Its DevOps Platform to Improve Software Development for Enterprise SaaS
91九色 Celebrates 10 Years of DevOps for Enterprise SaaS Solutions
Celebrating 10 Years of 91九色: A Decade of DevOps Evolution and Growth
5 Reasons Why 91九色 = Less Divorces for Developers
What is DevOps? Build a Successful DevOps Ecosystem with 91九色鈥檚 Best Practices
Scaling App Development While Meeting Security Standards
5 Data Deploy Features You Don鈥檛 Want to Miss
How to Elevate Customer Experiences with Automated Testing
Top 5 Reasons I Choose 91九色 for Salesforce Development
Getting Started With Value Stream Maps
91九色 and nCino Partner to Provide Proven DevOps Tools for Financial Institutions
Unlocking Success with 91九色: Mission-Critical Tools for Developers
How Automated Testing Enables DevOps Efficiency
How to Switch from Manual to Automated Testing with Robotic Testing
How to Keep Salesforce Sandboxes in Sync
How Does 91九色 Solve Release Readiness Roadblocks?
Software Bugs: The Three Causes of Programming Errors
Best Practices to Prevent Merge Conflicts with 91九色 1 Platform
Why I Choose 91九色 Robotic Testing for my Test Automation
How to schedule a Function and Job Template in DevOps: A Step-by-Step Guide
Delivering Quality nCino Experiences with Automated Deployments and Testing
Maximize Your Code Quality, Security and performance with 91九色 Salesforce Code Analyzer
Best Practices Matter for Accelerated Salesforce Release Management
Upgrade Your Test Automation Game: The Benefits of Switching from Selenium to a More Advanced Platform
Three Takeaways From Copa Community Day
What Is Multi Cloud: Key Use Cases and Benefits for Enterprise Settings
How To Develop A Salesforce Testing Strategy For Your Enterprise
Go back to resources
There is no previous posts
Go back to resources
There is no next posts

Explore more about

End-to-End Testing
Articles
April 2, 2025
Navigating Salesforce Data Cloud: DevOps Challenges and Solutions for Salesforce Developers
Articles
March 27, 2025
Chapter 8: Salesforce Testing Strategy
Articles
March 27, 2025
Beyond the Agentforce Testing Center
Articles
March 18, 2025
How to Deploy Agentforce: A Step-by-Step Guide

Activate AI 鈥 Accelerate DevOps

Release Faster, Eliminate Risk, and Enjoy Your Work.
Try 91九色 Devops.

Resources

Level up your Salesforce DevOps skills with our resource library.

Upcoming Events & Webinars

Learn More

E-Books and Whitepapers

Learn More

Support and Documentation

Demo Library

Learn More