Challenges with Salesforce Testing with Selenium WebDriver

Selenium Open Source Salesforce Testing Test Automation
Challenges with Salesforce Testing with Selenium WebDriver
  • KiwiQAKiwiQA
  • November 10, 2022

Share blog

CRM (Customer Relationship Management) applications have become an integral part in solving customer queries and gathering feedback to improve product quality. As the name states, it helps in improving the relationship with the customers.

Almost all of us would have interacted (or chatted) with the CRM executives when you would have faced issues on websites in e-commerce, online travel, or any such category. CRM software is also used to capture and nurture leads that are further used for business development. Though there are a number of CRM software(s) available in the market, Salesforce still leads the race!

As per reports , Salesforce CRM has retained its #1 ranking even in 2022. It has held this position for the last nine years! In case you are a Salesforce developer, you should also focus on salesforce CRM testing along with the development of the application.

Irrespective of the form of application, it is important to use relevant automated frameworks and tools to expedite the testing process. How can we leave out Selenium WebDriver when we are discussing automated testing? For starters, Selenium WebDriver is one of the most popular test automation frameworks used for UI-based testing.

Selenium WebDriver is popular since it is open-source and can be leveraged to run automated tests at a large scale using cloud Selenium Grid. The test code interacts with the elements in the DOM (Document Object Model) using the corresponding browser driver and language specific Selenium WebDriver APIs.

The question is “Can Selenium WebDriver be used for automated testing of Salesforce CRM applications?” This is what we intend to unravel in this blog, the learnings of which will help you in kick-starting your Salesforce automation testing journey with Selenium WebDriver.

What is Selenium WebDriver

Selenium WebDriver is a cross-platform or cross-browser test automation framework that comes with numerous open-source APIs that let you access elements on the page (or DOM). The framework was introduced way back in 2006.

At the time of writing this blog, the latest version of Selenium is 4.5.0. Selenium 4.0 is W3C compliant which also means that you can expect your tests to be less flaky in comparison to tests written with the Selenium 3 framework. All of this is under the assumption that you have designed your Selenium automation tests well!

Selenium provides WebDriver APIs in six major programming languages – Python, Java, JavaScript, C#, PHP, and Ruby. It also has a vibrant community.

Selenium 4 Architecture

Selenium WebDriver can be used for automating scenarios of Salesforce CRM applications but there are a significant number of challenges that you would encounter in the journey!

Using Selenium WebDriver for Salesforce CRM Testing

Now that we have covered the ‘what’ of Selenium WebDriver, lets deep dive into some of the major challenges that you might encounter when using Selenium for Salesforce testing.

Handling Frames

If you have used Selenium WebDriver for automation testing, you would agree that it can be seamlessly used for handling frames (or iFrames). Salesforce CRM applications can consist of dynamic frames that can load the content inside it in a dynamic manner.

Though Selenium WebDriver provides the switchTo() method to switch to the corresponding iFrame and switch back to the parent frame; handling dynamic frames can be extremely challenging. Figuring out the ideal locator and handling nested or hidden frames in the Salesforce CRM application might increase the flakiness quotient of the test code.

Since each window in the application can have a number of frames, switching back & forth between frames and introducing delays to handle dynamic content might elongate the test code. This might have a negative impact on the maintainability of the test code.

Choosing best-suited locators

Dynamic content has been around since the time AJAX was introduced in the market. Though Selenium WebDriver can handle dynamic content, the challenge arises in choosing the best-suited locators for identifying elements on which you want to perform the respective actions.

ID, Name, CSSSelector, link text, partial link text, and XPath are some of the widely used selectors in Selenium. So where does the challenge arise if there are so many selectors up your sleeves? Well, Salesforce CRM applications are known to have numerous dynamic elements that do not have a fixed ID, class, or other popular locator.

Though you have the flexibility of using dynamic (not static) XPaths, you might end up spending a considerable amount of time in choosing ideal locators for the Salesforce CRM application. The saga does not end there, your tests might become brittle or flaky in case the locator is not inline with the changes on the front-end interface.

Choosing the ideal type of wait (i.e. Implicit wait, Explicit wait, or Fluent wait) might not be sufficient to handle issues that can come with automated testing of dynamic content. An experienced Salesforce CRM testing services company can help you in choosing the ideal automation framework for testing Salesforce CRM applications. Not only that, they can groom the QA team so that the members can use the best practices when devising tests.

Handling content in tables

The difference between some other form of web application and a CRM application is that the page might consist of a lot of dynamically populated content, including database driven tables.

Sample Salesforce CRM Application

As shown in the above Salesforce CRM application, the layout seems simple but the content in the frame on the right side looks complicated to automate! You might come across rows that are populated dynamically and varied frame layouts for different forms. Even best usage of Page Object Model (POM) design pattern and ideal locator might not be a savior in such cases.

You might also come across scenarios where tabs are created dynamically depending on the data that is shown (or selected) on the page. Existing methods like sendKeys() might not be enough for automating such complex dynamic test cases.

Apart from the major challenges mentioned above, your Selenium automation test suite must also be capable of handling Shadow DOM, dynamic pop-ups, dynamic tabs, and more.

Till now, we have seen the problem with Selenium WebDriver for Salesforce automation testing. So what is the solution? Well, instead of using code-based tools like Selenium WebDriver, you should opt for codeless automation tools like Leapwork, AccelQ, Selenium IDE, amongst others. You might face a bit of a hassle with test maintainability but the effort spent will be considerably less when compared to maintaining and scaling Selenium test suite.


Automation of Salesforce CRM applications is largely different when compared to automating other forms of web applications. Apart from dynamic content, you would also come across scenarios where your test has to handle dynamic tabs, dynamically loaded tables, etc.

Selenium WebDriver might not be the ideal option for automated testing of Salesforce CRM applications. Rather you should opt for codeless automation tools, few of which we have discussed during the course of this blog.

Since time to market is extremely important, it is recommended to onboard a proven global & experienced outsourced QA vendor with expertise in providing Salesforce testing services. This association will help in improving test coverage, creating maintainable and scalable tests, and accelerating the product release cycles.

What tool are you using for automating Salesforce CRM testing? Leave the name in the comments section, we will also add the tool name in this blog…

3 1 vote
Article Rating
Notify of
Inline Feedbacks
View all comments

Don't stay behind!
Sign up for our all-in-one newsletter!

Join the like-minded community & get the latest updates and insights on software testing technological transformation around the globe. Don't miss out.

Explore an ingenious approach to software testing.

Let's begin.

Get in Touch with us

This field is for validation purposes and should be left unchanged.
Would love your thoughts, please comment.x